diff app/view/grid/DatensatzErzeuger.js @ 984:b21421ba6917 stammdatengrids

added buttons for datensatzerzeuger, pobenehmer, added controllers
author Dustin Demuth <dustin@intevation.de>
date Thu, 10 Dec 2015 08:30:14 +0100
parents d8b0b23047b1
children 6afdbc8ee920 77e22ad5cc84
line wrap: on
line diff
--- a/app/view/grid/DatensatzErzeuger.js	Tue Dec 08 15:59:00 2015 +0100
+++ b/app/view/grid/DatensatzErzeuger.js	Thu Dec 10 08:30:14 2015 +0100
@@ -46,6 +46,18 @@
                 xtype: 'tbtext',
                 id: 'tbtitle',
                 text: i18n.getMsg('de.gridTitle')
+            },
+            '->',
+            {
+                text: i18n.getMsg('de.button.add'),
+                icon: 'resources/img/list-add.png',
+                action: 'add',
+                disabled: true // disabled on startup, will be enabled by setStore
+            }, {
+                text: i18n.getMsg('de.button.delete'),
+                icon: 'resources/img/list-remove.png',
+                action: 'delete',
+                disabled: true // disabled on startup, will be enabled by controller if necessary
             }]
         }];
 
@@ -81,6 +93,7 @@
             header: i18n.getMsg('bezeichnung'),
             dataIndex: 'bezeichnung',
             editor: {
+                allowBlank: false,
                 xtype: 'textfield'
             }
         }, {
@@ -100,7 +113,7 @@
             },
             editor: {
                 xtype: 'combobox',
-                store: Ext.data.StoreManager.get('messstellenFiltered'),
+                store: Ext.data.StoreManager.get('messstellen'),
                 displayField: 'messStelle',
                 valueField: 'id',
                 allowBlank: false
@@ -128,14 +141,17 @@
     setStore: function(store){
         var i18n = Lada.getApplication().bundle;
 
-        this.removeDocked(Ext.getCmp('ptbar'), true);
-        this.reconfigure(store);
-        this.addDocked([{
-            xtype: 'pagingtoolbar',
-            id: 'ptbar',
-            dock: 'bottom',
-            store: store,
-            displayInfo: true
-        }]);
+        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
+            }]);
+        }
     }
 });

http://lada.wald.intevation.org