LP#1777207: teach prepend() how to reset sorting
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 12 Jul 2019 15:08:29 +0000 (11:08 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 12 Jul 2019 15:08:29 +0000 (11:08 -0400)
commit92e70b58d34b141fd0453b85a2af7f2d973cea4e
tree808e6f306b2566cc991789a74f6de79379d87430
parent68893029f0d45460320ffcb780d3d34ba21cc1ef
LP#1777207: teach prepend() how to reset sorting

This patch gives prepend() an option to reset the sort order
(and offset) and makes the checkin and checkout grids use that option.

The purpose of this is to retain the performance benefit
of prepend(), as otherwise prepend() will do a full collect()
when a sort order is in effect.

On the checkin and checkout grids, due to a quirk of how
sorting in arrayNotifier-based data sources work, the grids
will behave like this:

- User processes a bunch of items, with each new one
  showing up at the top of the list
- User sorts the grid to look at something
- User processes another item. A collect() happens.
  The new item will show up at the top of the list, with the remaining
  items following the previous sort order.
- User processes more items; the prepending will coninue
  and remain fast.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
Open-ILS/web/js/ui/default/staff/services/grid.js