comparison app/controller/Messwert.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 fe51239321d9
children 2b886fc38282
comparison
equal deleted inserted replaced
361:8a3991b5c200 362:6a7a9267e00f
49 messung.set('messungsId', button.parentId); 49 messung.set('messungsId', button.parentId);
50 var view = Ext.widget('messwertecreate', {model: messung}); 50 var view = Ext.widget('messwertecreate', {model: messung});
51 }, 51 },
52 editItem: function(grid, record) { 52 editItem: function(grid, record) {
53 console.log('Editing Messwert'); 53 console.log('Editing Messwert');
54 var probe = this.getProbenStore().getById(record.get('probeId')); 54 record.getAuthInfo(this.initEditWindow)
55 console.log("Loaded Messwert with ID " + record.getId()); //outputs ID
56 },
57 initEditWindow: function(record, readonly, owner) {
55 var view = Ext.widget('messwertecreate', {model: record}); 58 var view = Ext.widget('messwertecreate', {model: record});
56 if (probe.get('readonly') === true) { 59 var ignore = Array();
60 if (readonly) {
57 var form = view.down('form'); 61 var form = view.down('form');
58 form.setReadOnly(true); 62 form.setReadOnly(true, ignore);
59 } 63 }
60
61 console.log("Loaded Messwert with ID " + record.getId()); //outputs ID
62 }, 64 },
63 deleteItem: function(button) { 65 deleteItem: function(button) {
64 var grid = button.up('grid'); 66 var grid = button.up('grid');
65 var selection = grid.getView().getSelectionModel().getSelection()[0]; 67 var selection = grid.getView().getSelectionModel().getSelection()[0];
66 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ 68 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){

http://lada.wald.intevation.org