Bugzilla – Attachment 113120 Details for
Bug 24533
Improved sorting in checkouts table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24533: Switch to aDataSort for multi-column sorting
Bug-24533-Switch-to-aDataSort-for-multi-column-sor.patch (text/plain), 5.27 KB, created by
Martin Renvoize (ashimema)
on 2020-11-05 14:51:59 UTC
(
hide
)
Description:
Bug 24533: Switch to aDataSort for multi-column sorting
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-05 14:51:59 UTC
Size:
5.27 KB
patch
obsolete
>From 4d9f72950c4ead6bf9b274ca4eb651d58e98b323 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 24533: 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. > >When sorting by due date you are much more likely to want the true date >sorting without forcing a primary sort on the grouping column. We achieve >that by removing the primary sort on checkout date and disable rowGrouping >in such a case. >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 45 ++++++++++++++------ > 1 file changed, 33 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index b4077ce9ac..13d619fe96 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -354,50 +354,58 @@ $(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 ? oObj.homebranch.escapeHtml() : '' ); >- } >+ }, >+ "aDataSort": [1,8] > }, > { > "mDataProp": "issuedate", > "bVisible": false, > }, > { >- "iDataSort": 10, // Sort on hidden unformatted issuedate column >+ "aDataSort": [1,10], // Sort on hidden unformatted issuedate column > "mDataProp": "issuedate_formatted", > }, > { > "mDataProp": function ( oObj ) { > return (oObj.branchname ? oObj.branchname.escapeHtml() : '' ); >- } >+ }, >+ "aDataSort": [1,11] > }, > { > "mDataProp": function ( oObj ) { > return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' ); >- } >+ }, >+ "aDataSort": [1,12] > }, > { > "mDataProp": function ( oObj ) { >@@ -408,19 +416,22 @@ $(document).ready(function() { > "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, >@@ -650,6 +661,16 @@ $(document).ready(function() { > collision: "none" > }); > } >+ >+ // Disable rowGroup when sorting on due date >+ $("#issues-table").on( 'order.dt', function(){ >+ var order = issuesTable.api().order(); >+ if ( order[0][0] === 3 ) { >+ issuesTable.api().rowGroup().disable(); >+ } else { >+ issuesTable.api().rowGroup().enable(); >+ } >+ }); > } > > // Don't load relatives' issues table unless it is clicked on >-- >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 24533
:
98088
|
99765
|
108836
| 113120