- Some documentation

- Fix bug ignoring nextmatch-sortheader's sortmode attribute
This commit is contained in:
Nathan Gray 2014-03-24 19:30:29 +00:00
parent bfac67cc17
commit b16c32714a

View File

@ -71,6 +71,7 @@ var et2_INextmatchSortable = new Interface({
var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
{ {
attributes: { attributes: {
// These normally set in settings, but broken out into attributes to allow run-time changes
"template": { "template": {
"name": "Template", "name": "Template",
"type": "string", "type": "string",
@ -100,6 +101,19 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
"description": "Customise the nextmatch - inline, after row count. Provided template becomes a child of nextmatch, and any input widgets are automatically bound to refresh the nextmatch on change. Any inputs with an onChange attribute can trigger the nextmatch to refresh by returning true.", "description": "Customise the nextmatch - inline, after row count. Provided template becomes a child of nextmatch, and any input widgets are automatically bound to refresh the nextmatch on change. Any inputs with an onChange attribute can trigger the nextmatch to refresh by returning true.",
"default": "" "default": ""
}, },
"no_filter": {
"name": "No filter",
"type": "boolean",
"description": "Hide the first filter",
"default": et2_no_init,
},
"no_filter2": {
"name": "No filter2",
"type": "boolean",
"description": "Hide the second filter",
"default": et2_no_init,
},
"onselect": { "onselect": {
"name": "onselect", "name": "onselect",
"type": "js", "type": "js",
@ -322,6 +336,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
// Determine the sort direction automatically if it is not set // Determine the sort direction automatically if it is not set
if (typeof _asc == "undefined") if (typeof _asc == "undefined")
{ {
_asc = true;
if (this.activeFilters["sort"].id == _id) if (this.activeFilters["sort"].id == _id)
{ {
_asc = !this.activeFilters["sort"].asc; _asc = !this.activeFilters["sort"].asc;
@ -2514,7 +2529,8 @@ var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortabl
click: function() { click: function() {
if (this.nextmatch && this._super.apply(this, arguments)) if (this.nextmatch && this._super.apply(this, arguments))
{ {
this.nextmatch.sortBy(this.id); // Send default sort mode if not sorted, otherwise send undefined to calculate
this.nextmatch.sortBy(this.id, this.sortmode == "none" ? !(this.options.sortmode.toUpperCase() == "DESC") : undefined);
return true; return true;
} }