From a84b6ae36c385ca0c6c0af5e30a57ceb368086e8 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 9 Jul 2019 14:43:18 -0400 Subject: [PATCH] LP#1777207: have eg-grid generate DOM nodes only for visible columns This patch changes an ng-show to an ng-if to generate DOM nodes for grid cells only for visible columns. Prior to this patch, all grid cells were generated, but the ones that corresponded to hidden columns would simply be set as hidden. By not generating the cells unless they're meant to be visible, grid refreshes for wide grids (like the checkin table) render much more quickly for a couple reasons: - simply that there are fewer DOM nodes to process - probably more importantly, fewer AngularJS watches get created To test ------- [1] In the checkin grid, check in a large number of items, then observe/profile timing as you change the number of visible rows. [2] Apply the patch and repeat step 1. This time, the grid refreshe should be measurably (and visibly) faster. [3] Test other AngularJS grids and verify that grid display and grid actions are normal. Signed-off-by: Galen Charlton Signed-off-by: Dan Wells --- Open-ILS/src/templates/staff/share/t_autogrid.tt2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index 4d90a48408..73850e028c 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -324,7 +324,7 @@ ng-repeat="col in columns" ng-class="col.cssSelector" style="text-align:{{col.align}}; flex:{{col.flex}}" - ng-show="col.visible"> + ng-if="col.visible"> -- 2.43.2