[Lada-commits] [PATCH 7 of 9] If the user selects a search query add call setupColumns method to dynamically

Wald Commits scm-commit at wald.intevation.org
Tue Jul 23 11:46:35 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1374571907 -7200
# Node ID 4ca858026191df94728988a42ff11dc20ed41d19
# Parent  910cd477bfda71720b91d3b1c89537095c59d3b4
If the user selects a search query add call setupColumns method to dynamically
add columns to the table as defined in the searach query.

diff -r 910cd477bfda -r 4ca858026191 app/controller/Sql.js
--- 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();
     },


More information about the Lada-commits mailing list