comparison app/controller/Messungen.js @ 362:6a7a9267e00f

Issue56: Changed way how to set the form and window to readonly. Now all dialogs should habe proper readonly settings. Now the Save and Cancel button are displayed as needed.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 15 Aug 2013 14:07:35 +0200
parents c5b8c0d8aec3
children debfcc7713e3
comparison
equal deleted inserted replaced
361:8a3991b5c200 362:6a7a9267e00f
78 params: { 78 params: {
79 probeId: record.get('probeId'), 79 probeId: record.get('probeId'),
80 messungsId: record.get('messungsId') 80 messungsId: record.get('messungsId')
81 } 81 }
82 }); 82 });
83 var probe = this.getProbenStore().getById(record.get('probeId')); 83 record.getAuthInfo(this.initEditWindow);
84 console.log("Loaded Messung with ID " + record.getId()); //outputs ID
85 },
86 initEditWindow: function(record, readonly, owner) {
84 var view = Ext.widget('messungenedit', {model: record}); 87 var view = Ext.widget('messungenedit', {model: record});
85 if (probe.get('readonly') === true) { 88 var ignore = Array();
89 if (owner) {
90 ignore.push('fertig');
91 }
92 if (readonly) {
86 var form = view.down('form'); 93 var form = view.down('form');
87 // TODO: Field "fertig" must be editable (issue51). So we need to remove the
88 // readonly status if the user would be allowed to edit the probe
89 // if the "fertig" flag has not been set. (ti) <2013-08-08 10:24>
90 var ignore = Array();
91 ignore.push('fertig');
92 form.setReadOnly(true, ignore); 94 form.setReadOnly(true, ignore);
93 } 95 }
94 console.log("Loaded Messung with ID " + record.getId()); //outputs ID
95 }, 96 },
96 deleteItem: function(button) { 97 deleteItem: function(button) {
97 // Get selected item in grid 98 // Get selected item in grid
98 var grid = button.up('grid'); 99 var grid = button.up('grid');
99 var selection = grid.getView().getSelectionModel().getSelection()[0]; 100 var selection = grid.getView().getSelectionModel().getSelection()[0];

http://lada.wald.intevation.org