Commit 0e604542 authored by Sven Franck's avatar Sven Franck

fix: switching column sorting to new JSON API

parent 81a111fa
......@@ -416,6 +416,7 @@
**/
// TODO: integrate with app/app.sort, do we really need 2 methods
"sort": function (obj) {
// 1 or 5 state sorting (none|asc_abc|desc_abc|asc_123|desc_123)
switch (obj.element.getAttribute("data-direction")) {
case "desc_abc":
......@@ -436,7 +437,6 @@
app.sort(obj, undefined, "sort-by-order", "sort");
break;
default:
// also handles single state sorting
app.sort(obj, "desc_abc", "sort", "sort-by-alphabet-alt");
break;
}
......@@ -3535,7 +3535,7 @@
link = undefined;
attributes = {};
logic = {};
property = field.column;
property = field.field;
if (field.show) {
if (field.merge === undefined) {
......@@ -3600,7 +3600,7 @@
"data-action": field.href ? null : "sort",
"data-external": field.external || null,
"data-reference": field.href ? null : spec.config.reference,
"data-column-title": field.href ? null : field.column,
"data-column-title": field.href ? null : field.field,
"text": title || null,
"img": field.image ? (typeof field.image === "string" ?
{"href": field.image, "alt": ""} : field.image) :
......@@ -4617,11 +4617,13 @@
* @param {string} direction Direction to sort
* @param {string} prev Previous icon
* @param {string} next Next icon
* @param {boolean} single Single state sort
*/
// TODO: overwrite direction on single state sorting
app.sort = function (config, direction, prev, next) {
app.sort = function (config, direction, prev, next, single) {
var i, in_array, sort_by, delay;
// NOTE: if column title is not set, we might be sortling a list!
sort_by = config.element.getAttribute("data-column-title");
if (sort_by) {
......@@ -4634,8 +4636,6 @@
);
delay = 500;
} else {
// single state sorting
sort_by = config.id.split("_")[0] + "_" + config.element.value;
delay = 0;
}
......@@ -5168,7 +5168,7 @@
if (l > 0) {
info += " & ";
}
info += options.sort_on[l][0].split("_")[1];
info += options.sort_on[l][0];
}
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment