comparison app/controller/Kommentare.js @ 55:4fa3fba50f79

Added dialog for editing kommentare. Open the dialog on double click on a kommentar in the kommentarlist.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 28 May 2013 11:39:14 +0200
parents 3c7bfff8bd64
children 9e23eca8dfc7
comparison
equal deleted inserted replaced
54:3c7bfff8bd64 55:4fa3fba50f79
1 Ext.define('Lada.controller.Kommentare', { 1 Ext.define('Lada.controller.Kommentare', {
2 extend: 'Ext.app.Controller', 2 extend: 'Ext.app.Controller',
3 views: [ 3 views: [
4 'kommentare.List' 4 'kommentare.List',
5 'kommentare.Edit'
5 ], 6 ],
6 stores: [ 7 stores: [
7 'Kommentare' 8 'Kommentare'
8 ], 9 ],
9 models: [ 10 models: [
12 init: function() { 13 init: function() {
13 console.log('Initialising the Kommentare controller'); 14 console.log('Initialising the Kommentare controller');
14 this.control({ 15 this.control({
15 // CSS like selector to select element in the viewport. See 16 // CSS like selector to select element in the viewport. See
16 // ComponentQuery documentation for more details. 17 // ComponentQuery documentation for more details.
17 //'probenlist': { 18 'kommentarelist': {
18 // // Map the "render" event to the given function. 19 // Map Doubleclick on rows of the probenlist.
19 // render: this.onPanelRendered, 20 itemdblclick: this.editKommentar
20 // // Map Doubleclick on rows of the probenlist. 21 }
21 // itemdblclick: this.editProbe
22 //},
23 //'probenedit button[action=save]': { 22 //'probenedit button[action=save]': {
24 // click: this.updateProbe 23 // click: this.updateProbe
25 //} 24 //}
26 }); 25 });
27 }, 26 },
28 editKommentar: function(grid, record) { 27 editKommentar: function(grid, record) {
29 //console.log('Double click on ' + record.get('probeId')); 28 console.log('Double click on ' + record.get('id'));
30 //// Create new window to edit the seletced record. 29 // Create new window to edit the seletced record.
31 //var view = Ext.widget('probenedit'); 30 var view = Ext.widget('kommentaredit');
32 //var form = view.down('form'); 31 var form = view.down('form');
33 //form.loadRecord(record); 32 form.loadRecord(record);
34
35 //// Load kommentare
36 //var kommentare = form.down('kommentarelist'); //form.down('kommentare');
37 //var kstore = kommentare.getStore();
38 //kstore.load({
39 // params: {
40 // probe: record.data['probeId']
41 // }
42 //});
43
44 //// Set form data
45 //console.log("Loaded probe with ID " + record.getId()); //outputs ID
46 }, 33 },
47 updateKommentar: function(button) { 34 updateKommentar: function(button) {
48 //console.log('Click save'); 35 //console.log('Click save');
49 //// We only have a reference to the button here but we really wnat to 36 //// We only have a reference to the button here but we really wnat to
50 //// get the form and the window. So first get the window and form and 37 //// get the form and the window. So first get the window and form and

http://lada.wald.intevation.org