Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #6315

Category None
Changed by Galen Charlton <gmcohnoyoudont@equinoxinitiative.org>
Changed at Thu 18 Jul 2019 12:36:10
Repository git://git.evergreen-ils.org/Evergreen.git
Project Evergreen
Branch master
Revision 1da6a8e7a207fc13d511a31947cb8d6315fe4075


LP#1777207: teach egGrid how to prepend rows more efficiently
The checkin and checkout grids in the AngularJS client have
been doing full grid refreshes when adding a checkin or
checkout to their respective grids. While this does not
result in re-fetching data for the loans that were already
processed, as more entries get added to the grid the time
it takes to do a full digest of the grid contents during a
egGrid.collect() (which empties the list of displayed rows,
then refills it), gets progressively longer. Grids that have
only ~40 entries have been observed to take several seconds
purely on the AngularJS rendering phase.

This patch teaches egGrid a new prepend() method that
takes the first element from the underlying data source and
unshifts it onto the list of displayed grid rows, saving much
rendering time. The prepend() method will also force the
grid offset back to 0 if it isn't already. Note that if
an item that would be added via prepend() might duplicate an
existing row entry, prepend() will do a full collect() instead.

If the data source has sort options set, the prepend() will
remove them. For arrayNotifier-based data sources, as are used
in the checkin and checkout grids, this means that if the user
sorts the contents of the grid, then does a circ transaction,
the new transaction will still appear at the top of the list.
Due to the way arrayNotifier currently works, the remaining
entries will retain their previous ordering.

As an implementation note, prepend() is likely going to work
/only/ for arrayNotifier grid data sources.

To test
[1] In the checkin grid, check in a large number of items.
    Note that the time it takes to each each item gets
    progressively longer.
[2] Apply the patch and repeat step 1. This time, the time
    for each checkin should not significantly vary.
[3] Verify that column sorting works as expected.
[4] Upon sorting the grid, do more checkins and note that
    the new transactions show up at the top.
[5] Verify that the checkout grid continues to behave as expected.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>

Changed files