# HG changeset patch # User Raimund Renkert # Date 1426171842 -3600 # Node ID e1ab247583921f001b378ec21b11fb114250f097 # Parent f9c2e82ebc20c7f1d1c752a10cda6d7c52183112 Updated the ort grid controller. diff -r f9c2e82ebc20 -r e1ab24758392 app/controller/grid/Ort.js --- 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() {