Mercurial > lada > lada-client
changeset 602:e1ab24758392
Updated the ort grid controller.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Mar 2015 15:50:42 +0100 |
parents | f9c2e82ebc20 |
children | 9d0113bc2f70 |
files | app/controller/grid/Ort.js |
diffstat | 1 files changed, 10 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controller/grid/Ort.js Thu Mar 12 15:49:18 2015 +0100 +++ b/app/controller/grid/Ort.js Thu Mar 12 15:50:42 2015 +0100 @@ -9,14 +9,14 @@ Ext.define('Lada.controller.grid.Ort', { extend: 'Ext.app.Controller', + requires: [ + 'Lada.view.window.OrtEdit' + ], + init: function() { this.control({ 'ortgrid': { - selectionchange: this.selectionChanged, - edit: this.gridSave - }, - 'ortgrid button[action=open]': { - click: this.open + itemdblclick: this.open }, 'ortgrid button[action=add]': { click: this.add @@ -27,27 +27,12 @@ }); }, - selectionChanged: function(grid, record) { - if (record) { - grid.view.panel.down('button[action=open]').enable(); - } - }, - - gridSave: function(editor, context) { - context.record.save({ - success: function() { - context.grid.store.reload(); - context.grid.up('window').initData(); - }, - failure: function() { - // TODO - } + open: function(grid, record) { + var win = Ext.create('Lada.view.window.OrtEdit', { + record: record }); - }, - - open: function() { - // todo - console.log('open'); + win.show(); + win.initData(); }, add: function() {