Bugzilla – Attachment 98042 Details for
Bug 23493
jquery.dataTables.rowGrouping.js is no longer maintained, but there is an official DataTables version we could switch to
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting
Bug-23493-follow-up-Switch-to-aDataSort-for-multi-.patch (text/plain), 5.31 KB, created by
Martin Renvoize (ashimema)
on 2020-01-28 17:20:46 UTC
(
hide
)
Description:
Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-01-28 17:20:46 UTC
Size:
5.31 KB
patch
obsolete
>From 57ffed9f4ed048ff9de6e0008e3ea2506a07457f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 28 Jan 2020 17:18:44 +0000 >Subject: [PATCH] Bug 23493: (follow-up) Switch to aDataSort for multi-column > sorting > >This patch adds aDataSort configurations for each sortable column such >that we always maintain the group sorting primarily and apply a >secondary sort using the column in question. >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 41 ++++++++++++-------- > 1 file changed, 24 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 4cb3ddf89c..0f960ecf9e 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, > }, > { >- "iDataSort": 2, // Sort on hidden unformatted date due column >+ "aDataSort": [1,2], // Sort on hidden unformatted date due column > "mDataProp": function( oObj ) { > var due = oObj.date_due_formatted; > >@@ -344,68 +344,79 @@ $(document).ready(function() { > > return title; > }, >- "sType": "anti-the" >+ "sType": "anti-the", >+ "aDataSort": [1, 3] > }, > { > "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, > }, > { >- "iDataSort": 9, // Sort on hidden unformatted issuedate column >+ "aDataSort": [1,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 '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>'; >- } >+ }, >+ "aDataSort": [1,13] > }, > { > "mDataProp": function ( oObj ) { > if ( ! oObj.fine ) oObj.fine = 0; > return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).toFixed(2) + '<span>'; >- } >+ }, >+ "aDataSort": [1,14] > }, > { > "mDataProp": function ( oObj ) { > if ( ! oObj.price ) oObj.price = 0; > return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).toFixed(2) + '<span>'; >- } >+ }, >+ "aDataSort": [1,15] > }, > { > "bSortable": false, >@@ -607,10 +618,6 @@ $(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.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23493
:
92443
|
92444
|
97324
|
97344
|
97694
|
97704
|
98041
|
98042
|
98055
|
98056
|
98118
|
98132