comparison app/controller/Sql.js @ 28:4d60b9ebce15

Renamed sql modul into search. Further display The query selection as Combobox instead of a grid.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 16 May 2013 17:55:53 +0200
parents f964a50bfe57
children 897e3100c6da
comparison
equal deleted inserted replaced
27:e02d07abc4fe 28:4d60b9ebce15
1 Ext.define('Lada.controller.Sql', { 1 Ext.define('Lada.controller.Sql', {
2 extend: 'Ext.app.Controller', 2 extend: 'Ext.app.Controller',
3 views: [ 3 views: [
4 'sql.List' 4 'search.List'
5 ], 5 ],
6 stores: [ 6 stores: [
7 'Sql' 7 'Sql'
8 ], 8 ],
9 init: function() { 9 init: function() {
10 console.log('Initialising the Sql controller'); 10 console.log('Initialising the Sql controller');
11 this.control({ 11 this.control({
12 // CSS like selector to select element in the viewport. See 12 // CSS like selector to select element in the viewport. See
13 // ComponentQuery documentation for more details. 13 // ComponentQuery documentation for more details.
14 'sqllist': { 14 'queryselector': {
15 // Map the "render" event to the given function. 15 // Map the "render" event to the given function.
16 render: this.onPanelRendered, 16 render: this.onPanelRendered,
17 // Map Doubleclick on rows of the probenlist. 17 // Map Doubleclick on rows of the probenlist.
18 itemclick: this.selectSql 18 select: this.selectSql
19 } 19 }
20 }); 20 });
21 }, 21 },
22 onPanelRendered: function() { 22 onPanelRendered: function() {
23 console.log('The panel was rendered'); 23 console.log('The panel was rendered');
24 }, 24 },
25 selectSql: function(grid, record) { 25 selectSql: function(element, record, index) {
26 var selection = record.get('id'); 26 //var selection = record.get('id');
27 var selection = index;
27 var variables = Ext.getCmp('variables'); 28 var variables = Ext.getCmp('variables');
28 var result = Ext.getCmp('result'); 29 var result = Ext.getCmp('result');
29 console.log('Selected SQL ' + selection); 30 console.log('Selected SQL ' + selection);
30 //// Set correct form for the current SQL-Selection 31 //// Set correct form for the current SQL-Selection
31 //console.log('Length is ' + variables.items.length); 32 //console.log('Length is ' + variables.items.length);
42 //variables.add(currentVar); 43 //variables.add(currentVar);
43 //// Show the panel for the variable definiton. 44 //// Show the panel for the variable definiton.
44 //variables.show(); 45 //variables.show();
45 46
46 // Show the results. 47 // Show the results.
48 console.log('Loading store');
47 result.getStore().load(); 49 result.getStore().load();
50 console.log('Store loaded');
48 result.show(); 51 result.show();
49 } 52 }
50 }); 53 });
51 54
52 55

http://lada.wald.intevation.org