]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1697954: Provide client-side sorting for grids that can use it
authorMike Rylander <mrylander@gmail.com>
Wed, 14 Jun 2017 15:32:36 +0000 (11:32 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 30 Jun 2017 14:44:29 +0000 (10:44 -0400)
commit520215937726cba99ab6aeb8c16e689b2c3e0dd5
treec5c563402d1beeb4cd2902a03c427a11aea70d25
parent58e662f046b178ad7696a288c9e26546216902a1
LP#1697954: Provide client-side sorting for grids that can use it

There are several grids (items out, checkin, checkout, item status, etc) that
could benefit from the ability to sort their items, but either the data
provider uses a complex data structure or an API call that doesn't offer
sorting, or the item list is populated by user input rather than a call to the
server.  In those cases, sorting is not available.  However, if we know that
all the data in the grid is in client memory, it would be reasonable to offer
a client-side sort option.

This commit does that by teaching the grid to accept a "clientsort" feature
and teaching arrayNotifier how to sort the items currently stored.  The sort
works over any mix of IDL objects, hashes, and flattened fields, supports
multisort, and pushes "nulls" to the end of the list.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Andrea Neiman <abneiman@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/services/grid.js