changeset 1400:69ebd572fe5c release-2.5

Collapse rows on page change in probe and messung filter grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 16 Mar 2017 17:29:50 +0100
parents 78839fe4b9b7
children 7c0045bf1397
files app/controller/grid/MessungList.js app/controller/grid/ProbeList.js
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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));
+            }
+        }
     }
 });
--- 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));
+            }
+        }
     }
 
 });

http://lada.wald.intevation.org