Mercurial > lada > lada-client
comparison app/controller/grid/Ort.js @ 602:e1ab24758392
Updated the ort grid controller.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Mar 2015 15:50:42 +0100 |
parents | cf328526b5bb |
children | 477379250512 |
comparison
equal
deleted
inserted
replaced
601:f9c2e82ebc20 | 602:e1ab24758392 |
---|---|
7 */ | 7 */ |
8 | 8 |
9 Ext.define('Lada.controller.grid.Ort', { | 9 Ext.define('Lada.controller.grid.Ort', { |
10 extend: 'Ext.app.Controller', | 10 extend: 'Ext.app.Controller', |
11 | 11 |
12 requires: [ | |
13 'Lada.view.window.OrtEdit' | |
14 ], | |
15 | |
12 init: function() { | 16 init: function() { |
13 this.control({ | 17 this.control({ |
14 'ortgrid': { | 18 'ortgrid': { |
15 selectionchange: this.selectionChanged, | 19 itemdblclick: this.open |
16 edit: this.gridSave | |
17 }, | |
18 'ortgrid button[action=open]': { | |
19 click: this.open | |
20 }, | 20 }, |
21 'ortgrid button[action=add]': { | 21 'ortgrid button[action=add]': { |
22 click: this.add | 22 click: this.add |
23 }, | 23 }, |
24 'ortgrid button[action=delete]': { | 24 'ortgrid button[action=delete]': { |
25 click: this.remove | 25 click: this.remove |
26 } | 26 } |
27 }); | 27 }); |
28 }, | 28 }, |
29 | 29 |
30 selectionChanged: function(grid, record) { | 30 open: function(grid, record) { |
31 if (record) { | 31 var win = Ext.create('Lada.view.window.OrtEdit', { |
32 grid.view.panel.down('button[action=open]').enable(); | 32 record: record |
33 } | |
34 }, | |
35 | |
36 gridSave: function(editor, context) { | |
37 context.record.save({ | |
38 success: function() { | |
39 context.grid.store.reload(); | |
40 context.grid.up('window').initData(); | |
41 }, | |
42 failure: function() { | |
43 // TODO | |
44 } | |
45 }); | 33 }); |
46 }, | 34 win.show(); |
47 | 35 win.initData(); |
48 open: function() { | |
49 // todo | |
50 console.log('open'); | |
51 }, | 36 }, |
52 | 37 |
53 add: function() { | 38 add: function() { |
54 // todo | 39 // todo |
55 console.log('add'); | 40 console.log('add'); |