comparison app/view/grid/Status.js @ 964:5b86baa038bc

removed delete button for messung-status
author Dustin Demuth <dustin@intevation.de>
date Thu, 12 Nov 2015 12:19:02 +0100
parents 6a6f2c6fe8ee
children a2c2039bb5d9
comparison
equal deleted inserted replaced
963:6a6f2c6fe8ee 964:5b86baa038bc
62 text: 'Hinzufügen', 62 text: 'Hinzufügen',
63 icon: 'resources/img/list-add.png', 63 icon: 'resources/img/list-add.png',
64 action: 'add', 64 action: 'add',
65 probeId: this.probeId, 65 probeId: this.probeId,
66 parentId: this.parentId 66 parentId: this.parentId
67 }, {
68 text: 'Löschen',
69 icon: 'resources/img/list-remove.png',
70 action: 'delete'
71 }] 67 }]
72 }]; 68 }];
73 this.columns = [{ 69 this.columns = [{
74 header: 'erstellt', 70 header: 'erstellt',
75 dataIndex: 'datum', 71 dataIndex: 'datum',
151 maxLength: 1000, 147 maxLength: 1000,
152 enforceMaxLength: true 148 enforceMaxLength: true
153 }, 149 },
154 sortable: false, 150 sortable: false,
155 }]; 151 }];
156 this.listeners = {
157 select: {
158 fn: this.activateRemoveButton,
159 scope: this
160 },
161 deselect: {
162 fn: this.deactivateRemoveButton,
163 scope: this
164 }
165 };
166 this.initData(); 152 this.initData();
167 this.callParent(arguments); 153 this.callParent(arguments);
168 this.setReadOnly(true); //Grid is always initialised as RO 154 this.setReadOnly(true); //Grid is always initialised as RO
169 }, 155 },
170 156
186 if (b == true){ 172 if (b == true){
187 //Readonly 173 //Readonly
188 if (this.getPlugin('rowedit')){ 174 if (this.getPlugin('rowedit')){
189 this.getPlugin('rowedit').disable(); 175 this.getPlugin('rowedit').disable();
190 } 176 }
191 this.down('button[action=delete]').disable();
192 this.down('button[action=add]').disable(); 177 this.down('button[action=add]').disable();
193 }else{ 178 }else{
194 //Writable 179 //Writable
195 if (this.getPlugin('rowedit')){ 180 if (this.getPlugin('rowedit')){
196 this.getPlugin('rowedit').enable(); 181 this.getPlugin('rowedit').enable();
197 } 182 }
198 //this.down('button[action=delete]').enable(); 183 //this.down('button[action=delete]').enable();
199 this.down('button[action=add]').enable(); 184 this.down('button[action=add]').enable();
200 } 185 }
201 },
202 /**
203 * Activate the "Remove Button"
204 */
205 activateRemoveButton: function(selection, record) {
206 var grid = this;
207 //only enable the remove buttone, when the grid is editable.
208 if (! grid.readOnly) {
209 grid.down('button[action=delete]').enable();
210 }
211 },
212 /**
213 * Deactivate the "Remove Button"
214 */
215 deactivateRemoveButton: function(selection, record) {
216 var grid = this;
217 //only enable the remove buttone, when the grid is editable.
218 if (! grid.readOnly) {
219 grid.down('button[action=delete]').disable();
220 }
221 } 186 }
222 }); 187 });

http://lada.wald.intevation.org