comparison app/controller/Sql.js @ 241:4ca858026191

If the user selects a search query add call setupColumns method to dynamically add columns to the table as defined in the searach query.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 23 Jul 2013 11:31:47 +0200
parents 78134e20e62d
children c5d7fae5997a
comparison
equal deleted inserted replaced
240:910cd477bfda 241:4ca858026191
28 }, 28 },
29 onPanelRendered: function() { 29 onPanelRendered: function() {
30 console.log('The panel was rendered'); 30 console.log('The panel was rendered');
31 }, 31 },
32 selectSql: function(element, record, index) { 32 selectSql: function(element, record, index) {
33 var result = Ext.getCmp('result');
33 var selection = element.getValue() - 1; 34 var selection = element.getValue() - 1;
34 console.log('Selected SQL ' + selection); 35 console.log('Selected SQL ' + selection);
35 for (var i = 0; i < queries.length; ++i) { 36 for (var i = 0; i < queries.length; ++i) {
36 var toHide = Ext.getCmp(queries[i]); 37 var toHide = Ext.getCmp(queries[i]);
37 toHide.hide(); 38 toHide.hide();
38 } 39 }
39 var toShow = Ext.getCmp(queries[selection]); 40 var toShow = Ext.getCmp(queries[selection]);
40 var buttons = Ext.getCmp('SearchBtnPanel'); 41 var buttons = Ext.getCmp('SearchBtnPanel');
41 this.reset(); 42 this.reset();
43 var displayFields = record[0].data.fields
44 result.setupColumns(displayFields);
42 toShow.show(); 45 toShow.show();
43 buttons.show(); 46 buttons.show();
44 }, 47 },
45 search: function(element, record, index) { 48 search: function(element, record, index) {
46 var result = Ext.getCmp('result'); 49 var result = Ext.getCmp('result');

http://lada.wald.intevation.org