[Lada-commits] [PATCH] Collapse rows on page change in probe and messung filter grid

Wald Commits scm-commit at wald.intevation.org
Thu Mar 16 17:29:57 CET 2017


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1489681790 -3600
# Branch release-2.5
# Node ID 69ebd572fe5c9ff0e5d679f6cb4b37b505b4b6bb
# Parent  78839fe4b9b7e8f916f87e356f50cbcc013de030
Collapse rows on page change in probe and messung filter grid.

diff -r 78839fe4b9b7 -r 69ebd572fe5c app/controller/grid/MessungList.js
--- a/app/controller/grid/MessungList.js	Thu Mar 16 14:44:04 2017 +0100
+++ b/app/controller/grid/MessungList.js	Thu Mar 16 17:29:50 2017 +0100
@@ -28,6 +28,9 @@
             },
             'messunglistgrid toolbar button[action=setstatus]': {
                 click: this.setStatus
+            },
+            'messunglistgrid pagingtoolbar': {
+                change: this.pageChange
             }
         });
         this.callParent(arguments);
@@ -297,5 +300,18 @@
         if (btn === 'yes') {
             location.reload();
         }
+    },
+
+    pageChange: function(toolbar) {
+        var grid = toolbar.up('grid');
+        var store = grid.getStore();
+        var rowExpander = grid.plugins[0]
+        var nodes = rowExpander.view.getNodes();
+        for (var i = 0; i < nodes.length; i++) {
+            var node = Ext.fly(nodes[i]);
+            if (node.hasCls(rowExpander.rowCollapsedCls) === false) {
+                rowExpander.toggleRow(i, store.getAt(i));
+            }
+        }
     }
 });
diff -r 78839fe4b9b7 -r 69ebd572fe5c app/controller/grid/ProbeList.js
--- a/app/controller/grid/ProbeList.js	Thu Mar 16 14:44:04 2017 +0100
+++ b/app/controller/grid/ProbeList.js	Thu Mar 16 17:29:50 2017 +0100
@@ -51,6 +51,9 @@
             'probelistgrid gridview': {
                 expandbody: this.expandBody,
                 collapsebody: this.collapseBody
+            },
+            'probelistgrid pagingtoolbar': {
+                change: this.pageChange
             }
         });
         this.callParent(arguments);
@@ -549,6 +552,19 @@
                 }
             }
         });
+    },
+
+    pageChange: function(toolbar) {
+        var grid = toolbar.up('grid');
+        var store = grid.getStore();
+        var rowExpander = grid.plugins[0]
+        var nodes = rowExpander.view.getNodes();
+        for (var i = 0; i < nodes.length; i++) {
+            var node = Ext.fly(nodes[i]);
+            if (node.hasCls(rowExpander.rowCollapsedCls) === false) {
+                rowExpander.toggleRow(i, store.getAt(i));
+            }
+        }
     }
 
 });


More information about the Lada-commits mailing list