torsten@54: Ext.define('Lada.controller.Kommentare', { torsten@54: extend: 'Ext.app.Controller', torsten@54: views: [ torsten@55: 'kommentare.List', torsten@55: 'kommentare.Edit' torsten@54: ], torsten@54: stores: [ torsten@54: 'Kommentare' torsten@54: ], torsten@54: models: [ torsten@54: 'Kommentar' torsten@54: ], torsten@54: init: function() { torsten@54: console.log('Initialising the Kommentare controller'); torsten@54: this.control({ torsten@54: // CSS like selector to select element in the viewport. See torsten@54: // ComponentQuery documentation for more details. torsten@55: 'kommentarelist': { torsten@55: // Map Doubleclick on rows of the probenlist. torsten@55: itemdblclick: this.editKommentar torsten@55: } torsten@54: //'probenedit button[action=save]': { torsten@54: // click: this.updateProbe torsten@54: //} torsten@54: }); torsten@54: }, torsten@54: editKommentar: function(grid, record) { torsten@55: console.log('Double click on ' + record.get('id')); torsten@55: // Create new window to edit the seletced record. torsten@55: var view = Ext.widget('kommentaredit'); torsten@55: var form = view.down('form'); torsten@55: form.loadRecord(record); torsten@54: }, torsten@54: updateKommentar: function(button) { torsten@54: //console.log('Click save'); torsten@54: //// We only have a reference to the button here but we really wnat to torsten@54: //// get the form and the window. So first get the window and form and torsten@54: //// the the record an values. torsten@54: //var win = button.up('window'); torsten@54: //var form = win.down('form'); torsten@54: //var record = form.getRecord(); torsten@54: //var values = form.getValues(); torsten@54: torsten@54: //record.set(values); torsten@54: //win.close(); torsten@54: //// synchronize the store after editing the record torsten@54: //// NOTE: The function 'getProbenStore' will be generated torsten@54: //// dynamically based on the Name of the configured Store!!! torsten@54: //this.getProbenStore().sync(); torsten@54: } torsten@54: });