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)
committerBill Erickson <berickxx@gmail.com>
Wed, 21 Jun 2017 15:15:14 +0000 (11:15 -0400)
commitddd3ccc0538e674e2d1ffc8ae62926a850058e95
treee6f9d9076f2b3c06985ebc010d594660ed01d0a7
parentc8b279f580b98ffc5bf5f56fb94b26e0de14ae12
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>
Open-ILS/web/js/ui/default/staff/services/grid.js