torsten@6: Ext.define('Lada.controller.Sql', { torsten@6: extend: 'Ext.app.Controller', torsten@6: views: [ torsten@6: 'sql.List' torsten@6: ], torsten@8: stores: [ torsten@8: 'Sql' torsten@8: ], torsten@6: init: function() { torsten@6: console.log('Initialising the Sql controller'); torsten@6: this.control({ torsten@6: // CSS like selector to select element in the viewport. See torsten@6: // ComponentQuery documentation for more details. torsten@17: 'sqllist': { torsten@6: // Map the "render" event to the given function. torsten@6: render: this.onPanelRendered, torsten@6: // Map Doubleclick on rows of the probenlist. torsten@6: itemclick: this.selectSql torsten@6: } torsten@6: }); torsten@6: }, torsten@6: onPanelRendered: function() { torsten@6: console.log('The panel was rendered'); torsten@6: }, torsten@6: selectSql: function(grid, record) { torsten@17: var selection = record.get('id'); torsten@25: var variables = Ext.getCmp('variables'); torsten@25: var result = Ext.getCmp('result'); torsten@25: console.log('Selected SQL ' + selection); torsten@25: //// Set correct form for the current SQL-Selection torsten@25: //console.log('Length is ' + variables.items.length); torsten@25: //if (variables.items.length > 1) { torsten@25: // console.log('Length is > than 1'); torsten@25: // variables.remove(currentVar.id); torsten@25: //} torsten@25: //if (selection == 1) { torsten@25: // currentVar = variables1; torsten@25: //} torsten@25: //else { torsten@25: // currentVar = variables2; torsten@25: //} torsten@25: //variables.add(currentVar); torsten@25: //// Show the panel for the variable definiton. torsten@25: //variables.show(); torsten@17: torsten@17: // Show the results. torsten@25: result.getStore().load(); torsten@25: result.show(); torsten@6: } torsten@6: }); torsten@17: torsten@17: torsten@17: var currentVar = null; torsten@17: var variables1 = { torsten@17: xtype: 'panel', torsten@17: id: 'variable1', torsten@17: border: false, torsten@17: html: 'Variablen für Abfrage 1' torsten@17: }; torsten@17: torsten@17: var variables2 = { torsten@17: xtype: 'panel', torsten@17: id: 'variable2', torsten@17: border: false, torsten@17: html: 'Variablen für Abfrage 2' torsten@17: };