comparison app/controller/grid/Probenzusatzwert.js @ 637:8acb3123b46c

Remove a new record on cancel in grids with rowediting plugin.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 Mar 2015 10:21:29 +0100
parents cf328526b5bb
children 5b2cbc6bc39a
comparison
equal deleted inserted replaced
636:f4f76fc04e28 637:8acb3123b46c
10 extend: 'Ext.app.Controller', 10 extend: 'Ext.app.Controller',
11 11
12 init: function() { 12 init: function() {
13 this.control({ 13 this.control({
14 'probenzusatzwertgrid': { 14 'probenzusatzwertgrid': {
15 edit: this.gridSave 15 edit: this.gridSave,
16 canceledit: this.cancelEdit
16 }, 17 },
17 'probenzusatzwertgrid button[action=add]': { 18 'probenzusatzwertgrid button[action=add]': {
18 click: this.add 19 click: this.add
19 }, 20 },
20 'probenzusatzwertgrid button[action=delete]': { 21 'probenzusatzwertgrid button[action=delete]': {
31 }, 32 },
32 failure: function() { 33 failure: function() {
33 // TODO 34 // TODO
34 } 35 }
35 }); 36 });
37 },
38
39 cancelEdit: function(editor, context) {
40 if (!context.record.get('id') ||
41 context.record.get('id') === '') {
42 editor.getCmp().store.remove(context.record);
43 }
36 }, 44 },
37 45
38 add: function(button) { 46 add: function(button) {
39 var record = Ext.create('Lada.model.Zusatzwert', { 47 var record = Ext.create('Lada.model.Zusatzwert', {
40 probeId: button.up('probenzusatzwertgrid').recordId 48 probeId: button.up('probenzusatzwertgrid').recordId

http://lada.wald.intevation.org