comparison app/controller/MessungenGrid.js @ 585:4251601c6305

Load status, messwerte and kommentare asynchronously.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 11 Mar 2015 13:13:56 +0100
parents 5af82dc8612d
children
comparison
equal deleted inserted replaced
584:8ed6c3fb8bda 585:4251601c6305
28 click: this.remove 28 click: this.remove
29 } 29 }
30 }); 30 });
31 }, 31 },
32 32
33 selectionChanged: function(grid, record) {
34 if (record) {
35 grid.view.panel.down('button[action=open]').enable();
36 }
37 },
38
39 gridSave: function(editor, context) {
40 context.record.save({
41 success: function() {
42 context.grid.store.reload();
43 context.grid.up('window').initData();
44 },
45 failure: function() {
46 // TODO
47 }
48 });
49 },
50
51 open: function(grid, record) { 33 open: function(grid, record) {
52 //Opens a detailed view of the Messung 34 //Opens a detailed view of the Messung
53 var win = Ext.create('Lada.view.window.MessungEdit', { 35 var win = Ext.create('Lada.view.window.MessungEdit', {
54 record: this.record 36 record: record
55 }); 37 });
56 win.show(); 38 win.show();
57 win.initData(); 39 win.initData();
58 // todo
59 console.log('opened window');
60 }, 40 },
61 41
62 add: function() { 42 add: function() {
63 // todo 43 // TODO
64 console.log('add'); 44 console.log('add');
65 }, 45 },
66 46
67 remove: function(button) { 47 remove: function(button) {
68 var grid = button.up('grid'); 48 var grid = button.up('grid');
69 var selection = grid.getView().getSelectionModel().getSelection()[0]; 49 var selection = grid.getView().getSelectionModel().getSelection()[0];
70 Ext.MessageBox.confirm('Messung löschen', 'Sind Sie sicher?', function(btn) { 50 Ext.MessageBox.confirm(
71 if (btn === 'yes') { 51 'Messung löschen',
72 selection.destroy({ 52 'Sind Sie sicher?',
73 success: function() { 53 function(btn) {
74 button.up('window').initData(); 54 if (btn === 'yes') {
75 }, 55 selection.destroy({
76 failure: function() { 56 success: function() {
77 } 57 button.up('window').initData();
78 }); 58 },
79 } 59 failure: function() {
60 }
61 });
62 }
80 }); 63 });
81 } 64 }
82 }); 65 });

http://lada.wald.intevation.org