diff app/view/grid/Orte.js @ 1021:1df6b6210b42 stammdatengrids

WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
author Dustin Demuth <dustin@intevation.de>
date Thu, 04 Feb 2016 16:31:46 +0100
parents 6afdbc8ee920
children 1bd4c0709bd6
line wrap: on
line diff
--- a/app/view/grid/Orte.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/grid/Orte.js	Thu Feb 04 16:31:46 2016 +0100
@@ -31,27 +31,6 @@
         var i18n = Lada.getApplication().bundle;
         this.emptyText = i18n.getMsg('orte.emptyGrid');
 
-        this.dockedItems = [{
-            xtype: 'toolbar',
-            dock: 'top',
-            items: [{
-                xtype: 'tbtext',
-                id: 'tbtitle',
-                text: i18n.getMsg('orte.gridTitle')
-            },
-            '->',
-            {
-                text: i18n.getMsg('orte.button.add'),
-                icon: 'resources/img/list-add.png',
-                action: 'add',
-                disabled: true // disabled on startup, will be enabled by setStore
-            }, {
-                text: i18n.getMsg('orte.button.delete'),
-                icon: 'resources/img/list-remove.png',
-                action: 'delete',
-                disabled: true // disabled on startup, will be enabled by controller if necessary
-            }]
-        }];
         this.columns = [{
             header: i18n.getMsg('orte.ortId'),
             dataIndex: 'ortId'
@@ -144,16 +123,21 @@
         var i18n = Lada.getApplication().bundle;
 
         if (store) {
-            this.removeDocked(Ext.getCmp('ptbar'), true);
             this.reconfigure(store);
-            this.down('button[action=add]').enable();
-            this.addDocked([{
-                xtype: 'pagingtoolbar',
-                id: 'ptbar',
-                dock: 'bottom',
-                store: store,
-                displayInfo: true
-            }]);
+
+            var ptbar = this.down('pagingtoolbar');
+            if (ptbar) {
+                this.removeDocked(ptbar);
+            }
+
+            if (store.pageSize > 0) {
+                this.addDocked([{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    store: store,
+                    displayInfo: true
+                }]);
+            }
         }
     }
 });

http://lada.wald.intevation.org