Mercurial > lada > lada-client
diff app/controller/Kommentare.js @ 55:4fa3fba50f79
Added dialog for editing kommentare. Open the dialog on double click on a
kommentar in the kommentarlist.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 28 May 2013 11:39:14 +0200 |
parents | 3c7bfff8bd64 |
children | 9e23eca8dfc7 |
line wrap: on
line diff
--- a/app/controller/Kommentare.js Tue May 28 11:20:24 2013 +0200 +++ b/app/controller/Kommentare.js Tue May 28 11:39:14 2013 +0200 @@ -1,7 +1,8 @@ Ext.define('Lada.controller.Kommentare', { extend: 'Ext.app.Controller', views: [ - 'kommentare.List' + 'kommentare.List', + 'kommentare.Edit' ], stores: [ 'Kommentare' @@ -14,35 +15,21 @@ this.control({ // CSS like selector to select element in the viewport. See // ComponentQuery documentation for more details. - //'probenlist': { - // // Map the "render" event to the given function. - // render: this.onPanelRendered, - // // Map Doubleclick on rows of the probenlist. - // itemdblclick: this.editProbe - //}, + 'kommentarelist': { + // Map Doubleclick on rows of the probenlist. + itemdblclick: this.editKommentar + } //'probenedit button[action=save]': { // click: this.updateProbe //} }); }, editKommentar: function(grid, record) { - //console.log('Double click on ' + record.get('probeId')); - //// Create new window to edit the seletced record. - //var view = Ext.widget('probenedit'); - //var form = view.down('form'); - //form.loadRecord(record); - - //// Load kommentare - //var kommentare = form.down('kommentarelist'); //form.down('kommentare'); - //var kstore = kommentare.getStore(); - //kstore.load({ - // params: { - // probe: record.data['probeId'] - // } - //}); - - //// Set form data - //console.log("Loaded probe with ID " + record.getId()); //outputs ID + console.log('Double click on ' + record.get('id')); + // Create new window to edit the seletced record. + var view = Ext.widget('kommentaredit'); + var form = view.down('form'); + form.loadRecord(record); }, updateKommentar: function(button) { //console.log('Click save');