Mercurial > lada > lada-client
comparison app/controller/Messungen.js @ 232:6ac95f587e10
Used new Editdialog and set the form readonly if the parent probe is readonly.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 17 Jul 2013 12:09:28 +0200 |
parents | 80df1451b4a9 |
children | f60472df54e3 |
comparison
equal
deleted
inserted
replaced
231:edb2b636319f | 232:6ac95f587e10 |
---|---|
1 Ext.define('Lada.controller.Messungen', { | 1 Ext.define('Lada.controller.Messungen', { |
2 extend: 'Ext.app.Controller', | 2 extend: 'Ext.app.Controller', |
3 views: [ | 3 views: [ |
4 'messungen.Create' | 4 'messungen.Create', |
5 'messungen.Edit' | |
5 ], | 6 ], |
6 stores: [ | 7 stores: [ |
7 'Proben', | 8 'Proben', |
8 'Messungen', | 9 'Messungen', |
9 'Messwerte', | 10 'Messwerte', |
71 probeId: record.get('probeId'), | 72 probeId: record.get('probeId'), |
72 messungsId: record.get('messungsId') | 73 messungsId: record.get('messungsId') |
73 } | 74 } |
74 }); | 75 }); |
75 var probe = this.getProbenStore().getById(record.get('probeId')); | 76 var probe = this.getProbenStore().getById(record.get('probeId')); |
76 record.set('readonly', probe.get('readonly')); | 77 var view = Ext.widget('messungenedit', {model: record}); |
77 var view = Ext.widget('messungencreate', {model: record}); | 78 if (probe.get('readonly') === true) { |
79 var form = view.down('form'); | |
80 form.setReadOnly(true); | |
81 } | |
78 console.log("Loaded Messung with ID " + record.getId()); //outputs ID | 82 console.log("Loaded Messung with ID " + record.getId()); //outputs ID |
79 }, | 83 }, |
80 deleteMessung: function(button) { | 84 deleteMessung: function(button) { |
81 // Get selected item in grid | 85 // Get selected item in grid |
82 var grid = button.up('grid'); | 86 var grid = button.up('grid'); |