comparison app/view/window/Messprogramm.js @ 762:1f3837b513d9

Only disable Add/Remove buttons of Messwertgrid and not the whole grid when no record is present
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 May 2015 12:37:36 +0200
parents 2e7e1a8bf79f
children ba8c0e754979
comparison
equal deleted inserted replaced
761:975183ab775e 762:1f3837b513d9
88 type: 'hbox', 88 type: 'hbox',
89 }, 89 },
90 items: [{ 90 items: [{
91 xtype: 'messmethodengrid', 91 xtype: 'messmethodengrid',
92 recordId: this.record? this.record.get('id') : null, 92 recordId: this.record? this.record.get('id') : null,
93 disabled: this.record? false : true,
94 flex: 1 93 flex: 1
95 }] 94 }]
96 }] 95 }]
97 }]; 96 }];
98 this.callParent(arguments); 97 this.callParent(arguments);
114 113
115 // If a record was passed to this window, 114 // If a record was passed to this window,
116 // create a Edit window 115 // create a Edit window
117 if (this.record) { 116 if (this.record) {
118 this.setLoading(true); 117 this.setLoading(true);
118 this.down('messmethodengrid').setReadOnly(false);
119 Ext.ClassManager.get('Lada.model.Messprogramm').load(this.record.get('id'), { 119 Ext.ClassManager.get('Lada.model.Messprogramm').load(this.record.get('id'), {
120 failure: function(record, action) { 120 failure: function(record, action) {
121 me.setLoading(false); 121 me.setLoading(false);
122 // TODO 122 // TODO
123 console.log('An unhandled Failure occured. See following Response and Record'); 123 console.log('An unhandled Failure occured. See following Response and Record');
148 148
149 } 149 }
150 // Create a Create Window 150 // Create a Create Window
151 else { 151 else {
152 var record = Ext.create('Lada.model.Messprogramm'); 152 var record = Ext.create('Lada.model.Messprogramm');
153 this.down('messmethodengrid').setReadOnly(true);
153 this.down('messprogrammform').setRecord(record); 154 this.down('messprogrammform').setRecord(record);
154 } 155 }
155 }, 156 },
156 157
157 //This was used in a Probewindow, I left it here for reference... 158 //This was used in a Probewindow, I left it here for reference...

http://lada.wald.intevation.org