changeset 1014:e9e974d31924 stammdatengrids

Set mandatory fields
author Dustin Demuth <dustin@intevation.de>
date Fri, 29 Jan 2016 14:51:17 +0100
parents 75ce503ab296
children 1df6b6210b42
files app/view/grid/DatensatzErzeuger.js app/view/grid/MessprogrammKategorie.js app/view/grid/Probenehmer.js
diffstat 3 files changed, 42 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/grid/DatensatzErzeuger.js	Tue Jan 26 12:29:59 2016 +0100
+++ b/app/view/grid/DatensatzErzeuger.js	Fri Jan 29 14:51:17 2016 +0100
@@ -44,7 +44,6 @@
             dock: 'top',
             items: [{
                 xtype: 'tbtext',
-                id: 'tbtitle',
                 text: i18n.getMsg('de.gridTitle')
             },
             '->',
@@ -87,14 +86,15 @@
             header: i18n.getMsg('daErzeugerId'),
             dataIndex: 'daErzeugerId',
             editor: {
+                xtype: 'textfield',
                 allowBlank: false
             }
         }, {
             header: i18n.getMsg('bezeichnung'),
             dataIndex: 'bezeichnung',
             editor: {
-                allowBlank: false,
-                xtype: 'textfield'
+                xtype: 'textfield',
+                allowBlank: false
             }
         }, {
             header: i18n.getMsg('mstId'),
@@ -132,12 +132,16 @@
         var i18n = Lada.getApplication().bundle;
 
         if (store) {
-            this.removeDocked(Ext.getCmp('ptbar'), true);
             this.reconfigure(store);
+
+            var ptbar = this.down('pagingtoolbar');
+            if (ptbar) {
+                this.removeDocked(ptbar);
+            }
+
             this.down('button[action=add]').enable();
             this.addDocked([{
                 xtype: 'pagingtoolbar',
-                id: 'ptbar',
                 dock: 'bottom',
                 store: store,
                 displayInfo: true
--- a/app/view/grid/MessprogrammKategorie.js	Tue Jan 26 12:29:59 2016 +0100
+++ b/app/view/grid/MessprogrammKategorie.js	Fri Jan 29 14:51:17 2016 +0100
@@ -44,7 +44,6 @@
             dock: 'top',
             items: [{
                 xtype: 'tbtext',
-                id: 'tbtitle',
                 text: i18n.getMsg('mk.gridTitle')
             },
             '->',
@@ -87,12 +86,14 @@
             header: i18n.getMsg('mplId'),
             dataIndex: 'mplId',
             editor: {
+                xtype: 'textfield',
                 allowBlank: false
             }
         }, {
             header: i18n.getMsg('bezeichnung'),
             dataIndex: 'bezeichnung',
             editor: {
+                xtype: 'textfield',
                 allowBlank: false
             }
         }, {
@@ -108,15 +109,21 @@
     setStore: function(store){
         var i18n = Lada.getApplication().bundle;
 
-        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
-        }]);
+        if (store) {
+            this.reconfigure(store);
+
+            var ptbar = this.down('pagingtoolbar');
+            if (ptbar) {
+                this.removeDocked(ptbar);
+            }
+
+            this.down('button[action=add]').enable();
+            this.addDocked([{
+                xtype: 'pagingtoolbar',
+                dock: 'bottom',
+                store: store,
+                displayInfo: true
+            }]);
+        }
     }
 });
--- a/app/view/grid/Probenehmer.js	Tue Jan 26 12:29:59 2016 +0100
+++ b/app/view/grid/Probenehmer.js	Fri Jan 29 14:51:17 2016 +0100
@@ -44,7 +44,6 @@
             dock: 'top',
             items: [{
                 xtype: 'tbtext',
-                id: 'tbtitle',
                 text: i18n.getMsg('pn.gridTitle')
             },
             '->',
@@ -86,66 +85,64 @@
             header: i18n.getMsg('bearbeiter'),
             dataIndex: 'bearbeiter',
             editor: {
-                allowBlank: false
+                xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('prnId'),
             dataIndex: 'prnId',
             editor: {
+                xtype: 'textfield',
                 allowBlank: false
             }
         }, {
             header: i18n.getMsg('bemerkung'),
             dataIndex: 'bemerkung',
             editor: {
-                allowBlank: false,
-                xtype: 'textfield'
+                xtype: 'textfield',
+                allowBlank: false
             }
         }, {
             header: i18n.getMsg('kurzBezeichnung'),
             dataIndex: 'kurzBezeichnung',
             editor: {
-                allowBlank: false,
-                xtype: 'textfield'
+                xtype: 'textfield',
+                allowBlank: false
             }
         }, {
             header: i18n.getMsg('ort'),
             dataIndex: 'ort',
             editor: {
-                allowBlank: false,
                 xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('plz'),
             dataIndex: 'plz',
             editor: {
-                allowBlank: false,
                 xtype: 'numberfield'
             }
         }, {
             header: i18n.getMsg('strasse'),
             dataIndex: 'strasse',
             editor: {
-                allowBlank: false,
                 xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('telefon'),
             dataIndex: 'telefon',
             editor: {
-                allowBlank: false
+                xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('tp'),
             dataIndex: 'tp',
             editor: {
-                allowBlank: false
+                xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('typ'),
             dataIndex: 'typ',
             editor: {
-                allowBlank: false
+                xtype: 'textfield'
             }
         }, {
             header: i18n.getMsg('letzteAenderung'),
@@ -161,12 +158,16 @@
         var i18n = Lada.getApplication().bundle;
 
         if (store) {
-            this.removeDocked(Ext.getCmp('ptbar'), true);
             this.reconfigure(store);
+
+            var ptbar = this.down('pagingtoolbar');
+            if (ptbar) {
+                this.removeDocked(ptbar);
+            }
+
             this.down('button[action=add]').enable();
             this.addDocked([{
                 xtype: 'pagingtoolbar',
-                id: 'ptbar',
                 dock: 'bottom',
                 store: store,
                 displayInfo: true

http://lada.wald.intevation.org