comparison app/controller/ProbenzusatzwertGrid.js @ 571:1dedce48e3e1

Implemented the 'add' button; fixed renderer and controller.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 Mar 2015 12:11:50 +0100
parents 98dee8166459
children 8d2cf853eed2
comparison
equal deleted inserted replaced
570:1f6a22107c8c 571:1dedce48e3e1
33 // TODO 33 // TODO
34 } 34 }
35 }); 35 });
36 }, 36 },
37 37
38 add: function() { 38 add: function(button) {
39 console.log('add'); 39 var record = Ext.create('Lada.model.Zusatzwert', {
40 probeId: button.up('probenzusatzwertgrid').recordId
41 });
42 button.up('probenzusatzwertgrid').store.insert(0, record);
43 button.up('probenzusatzwertgrid').rowEditing.startEdit(0, 1);
40 }, 44 },
41 45
42 remove: function(button) { 46 remove: function(button) {
43 var grid = button.up('grid'); 47 var grid = button.up('grid');
44 var selection = grid.getView().getSelectionModel().getSelection()[0]; 48 var selection = grid.getView().getSelectionModel().getSelection()[0];
45 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn) { 49 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn) {
46 if (btn === 'yes') { 50 if (btn === 'yes') {
47 selection.destroy({ 51 selection.destroy({
48 success: function() { 52 success: function() {
49 button.up('window').initData(); 53 button.up('window').initData();
54 grid.initData();
50 }, 55 },
51 failure: function() { 56 failure: function() {
57 // TODO
52 } 58 }
53 }); 59 });
54 } 60 }
55 }); 61 });
56 } 62 }

http://lada.wald.intevation.org