From 9aaf1e31dfb486e47653af8967fbe6d6bdb573a7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 29 Jan 2020 16:12:13 +0000 Subject: [PATCH] Revert "Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting" This reverts commit 930fedd46282bc46027332f4986f3baaee72b4ad. --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 41 ++++++++------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index ff3b900ad1..56984185d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -260,7 +260,7 @@ $(document).ready(function() { "bVisible": false, }, { - "aDataSort": [1,2], // Sort on hidden unformatted date due column + "iDataSort": 2, // Sort on hidden unformatted date due column "mDataProp": function( oObj ) { var due = oObj.date_due_formatted; @@ -344,79 +344,68 @@ $(document).ready(function() { return title; }, - "sType": "anti-the", - "aDataSort": [1, 3] + "sType": "anti-the" }, { "mDataProp": function ( oObj ) { return oObj.recordtype_description.escapeHtml(); - }, - "aDataSort": [1, 4] + } }, { "mDataProp": function ( oObj ) { return oObj.itemtype_description.escapeHtml(); - }, - "aDataSort": [1, 5] + } }, { "mDataProp": function ( oObj ) { return ( oObj.collection ? oObj.collection.escapeHtml() : '' ); - }, - "aDataSort": [1,6] + } }, { "mDataProp": function ( oObj ) { return ( oObj.location ? oObj.location.escapeHtml() : '' ); - }, - "aDataSort": [1,7] + } }, { "mDataProp": function ( oObj ) { return oObj.homebranch.escapeHtml(); - }, - "aDataSort": [1,8] + } }, { "mDataProp": "issuedate", "bVisible": false, }, { - "aDataSort": [1,9], // Sort on hidden unformatted issuedate column + "iDataSort": 9, // Sort on hidden unformatted issuedate column "mDataProp": "issuedate_formatted", }, { "mDataProp": function ( oObj ) { return oObj.branchname.escapeHtml(); - }, - "aDataSort": [1,11] + } }, { "mDataProp": function ( oObj ) { return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' ); - }, - "aDataSort": [1,12] + } }, { "mDataProp": function ( oObj ) { if ( ! oObj.charge ) oObj.charge = 0; return '' + parseFloat(oObj.charge).toFixed(2) + ''; - }, - "aDataSort": [1,13] + } }, { "mDataProp": function ( oObj ) { if ( ! oObj.fine ) oObj.fine = 0; return '' + parseFloat(oObj.fine).toFixed(2) + ''; - }, - "aDataSort": [1,14] + } }, { "mDataProp": function ( oObj ) { if ( ! oObj.price ) oObj.price = 0; return '' + parseFloat(oObj.price).toFixed(2) + ''; - }, - "aDataSort": [1,15] + } }, { "bSortable": false, @@ -618,6 +607,10 @@ $(document).ready(function() { } }, "fnInitComplete": function(oSettings, json) { + // Disable rowGrouping plugin after first use + // so any sorting on the table doesn't use it + //var oSettings = issuesTable.fnSettings(); + // Build a summary of checkouts grouped by itemtype var checkoutsByItype = json.aaData.reduce(function (obj, row) { obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1; -- 2.39.5