comparison app/view/window/MessungEdit.js @ 693:817524db4017

Readonly was missing
author Dustin Demuth <dustin@intevation.de>
date Thu, 26 Mar 2015 15:54:50 +0100
parents e88381fb3bdb
children b0f1dcdf981d
comparison
equal deleted inserted replaced
692:c31644b3d445 693:817524db4017
94 this.callParent(arguments); 94 this.callParent(arguments);
95 }, 95 },
96 96
97 initData: function() { 97 initData: function() {
98 this.clearMessages(); 98 this.clearMessages();
99 var that = this;
99 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), { 100 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
100 failure: function(record) { 101 failure: function(record) {
101 // TODO 102 // TODO
102 console.log(record); 103 console.log(record);
103 }, 104 },
115 me.close(); 116 me.close();
116 me.parentWindow.initData(); 117 me.parentWindow.initData();
117 } 118 }
118 else { 119 else {
119 me.record.set('treeModified', me.probe.get('treeModified')); 120 me.record.set('treeModified', me.probe.get('treeModified'));
121 that.disableForm();
120 } 122 }
121 } 123 }
122 }); 124 });
123 } 125 }
124 this.down('messungform').setRecord(record); 126 this.down('messungform').setRecord(record);
128 this.setMessages(json.errors, json.warnings); 130 this.setMessages(json.errors, json.warnings);
129 } 131 }
130 }, 132 },
131 scope: this 133 scope: this
132 }); 134 });
135 console.log(this.record);
136 if (this.record.get('readonly') == true){
137 this.disableForm();
138 }
139 },
140
141 disableForm: function(){
142 this.down('messungform').setReadOnly(true);
143 this.disableChildren();
144 },
145
146 enableForm: function(){
147 this.down('messungform').setReadOnly(false);
148 this.enableChildren();
149 },
150
151 disableChildren: function(){
152 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true);
153 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
154 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
155 },
156
157 enableChildren: function(){
158 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false);
159 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
160 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
133 }, 161 },
134 162
135 setMessages: function(errors, warnings) { 163 setMessages: function(errors, warnings) {
136 //todo this is a stub 164 //todo this is a stub
137 }, 165 },

http://lada.wald.intevation.org