changeset 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 910cd477bfda
children c8c53f162a22
files app/controller/Sql.js
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Sql.js	Tue Jul 23 11:30:57 2013 +0200
+++ b/app/controller/Sql.js	Tue Jul 23 11:31:47 2013 +0200
@@ -30,6 +30,7 @@
         console.log('The panel was rendered');
     },
     selectSql: function(element, record, index) {
+        var result = Ext.getCmp('result');
         var selection = element.getValue() - 1;
         console.log('Selected SQL ' + selection);
         for (var i = 0; i < queries.length; ++i) {
@@ -39,6 +40,8 @@
         var toShow = Ext.getCmp(queries[selection]);
         var buttons = Ext.getCmp('SearchBtnPanel');
         this.reset();
+        var displayFields = record[0].data.fields
+        result.setupColumns(displayFields);
         toShow.show();
         buttons.show();
     },

http://lada.wald.intevation.org