LP#1790169: ensure that the sort priority actually gets saved
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 7 Sep 2018 21:32:15 +0000 (17:32 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Sun, 1 Sep 2019 13:09:06 +0000 (09:09 -0400)
This is a WIP patch - there's still a problem with the saved
sort priorities actually getting used when a grid is initalized.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/eg2/src/app/share/grid/grid.ts
Open-ILS/web/js/ui/default/staff/services/grid.js

index 600f815..7835f45 100644 (file)
@@ -321,7 +321,7 @@ export class GridColumnSet {
             const c: GridColumnPersistConf = {name : col.name};
             if (col.align !== 'left') { c.align = col.align; }
             if (col.flex !== 2) { c.flex = Number(col.flex); }
-            if (Number(col.sort)) { c.sort = Number(c.sort); }
+            if (Number(col.sort)) { c.sort = Number(col.sort); }
             return c;
         });
     }
index 8421cc1..c347e2e 100644 (file)
@@ -256,6 +256,7 @@ angular.module('egGridMod',
                     // link columns to scope after loadConfig(), since it
                     // replaces the columns array.
                     $scope.columns = grid.columnsProvider.columns;
+                    grid.dataProvider.refresh();
                 });
 
                 // NOTE: grid.collect() is first called from link(), not here.
@@ -463,7 +464,7 @@ angular.module('egGridMod',
                     // No need to store col.visible, since that's implicit
                     if (col.align != 'left') c.align = col.align;
                     if (col.flex != 2) c.flex = col.flex;
-                    if (Number(col.sort)) c.sort = Number(c.sort);
+                    if (Number(col.sort)) c.sort = Number(col.sort);
                     return c;
                 });