changeset 737:4031b9aa8d83

merged heads
author Dustin Demuth <dustin@intevation.de>
date Mon, 20 Apr 2015 11:15:25 +0200
parents 47de91fb03bb (diff) 7ae9599bee39 (current diff)
children 2db5d54a5685
files
diffstat 4 files changed, 23 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Apr 20 11:13:29 2015 +0200
+++ b/.hgtags	Mon Apr 20 11:15:25 2015 +0200
@@ -29,3 +29,4 @@
 a9184ba5ee173cc1f96666643ae71bae2d61983c 1.0
 7c9475119861ebfd4c2f6ee25a5f053aa13b2af7 mockup-1.1
 9f557bd48c30c828619d12fbc4c755ac5c34a420 2.0-alpha1
+2d482dfaa41a9fad406f43c4003cc29d4f964129 2.0-beta1
--- a/app/controller/Filter.js	Mon Apr 20 11:13:29 2015 +0200
+++ b/app/controller/Filter.js	Mon Apr 20 11:15:25 2015 +0200
@@ -22,6 +22,8 @@
         'ProbenList'    // List of found Proben
     ],
 
+    displayFields: null,
+
     init: function() {
         this.control({
             // CSS like selector to select element in the viewport. See
@@ -52,25 +54,23 @@
      * selected search query
      */
     selectSql: function(element, record) {
-        var resultGrid = element.up('panel[name=main]').down('filterresultgrid');
         var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');
         var columns = element.up('fieldset').down('displayfield[name=columns]');
         var desc = element.up('fieldset').down('displayfield[name=description]');
-        var displayFields = record[0].data.results;
+        this.displayFields = record[0].data.results;
         var filterFields = record[0].data.filters;
 
-        this.reset();
+        this.reset(element);
 
         var columnString = [];
-        for (var i = 0; i < displayFields.length; i++) {
-            columnString.push(displayFields[i].header);
+        for (var i = 0; i < this.displayFields.length; i++) {
+            columnString.push(this.displayFields[i].header);
         }
         columns.setValue(columnString.join(', '));
         desc.setValue(record[0].data.description);
 
         // Setup Columns of the probenlist
-        displayFields.reverse();
-        resultGrid.setupColumns(displayFields);
+        this.displayFields.reverse();
 
         // Setup Filters of the probenlist
         //
@@ -183,6 +183,7 @@
      */
     search: function(element) {
         var resultGrid = element.up('panel[name=main]').down('filterresultgrid');
+        resultGrid.setupColumns(this.displayFields);
         var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');
         var search = element.up('fieldset').down('combobox[name=filter]');
 
@@ -202,15 +203,12 @@
         resultGrid.show();
     },
 
-    reset: function() {
-        // var buttons = Ext.getCmp('SearchBtnPanel');
-        // var result = Ext.getCmp('result');
-        // for (var i = 0; i < queries.length; ++i) {
-        //     var toHide = Ext.getCmp(queries[i]);
-        //     toHide.hide();
-        // }
-        // result.hide();
-        // buttons.hide();
+    reset: function(element) {
+        var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');
+        for (var i = filters.items.length - 1; i >= 0; i--) {
+            var filter = filters.items.items[i];
+            filter.clearValue();
+        }
     },
 
     about: function() {
--- a/app/view/widget/base/ComboBox.js	Mon Apr 20 11:13:29 2015 +0200
+++ b/app/view/widget/base/ComboBox.js	Mon Apr 20 11:15:25 2015 +0200
@@ -101,6 +101,10 @@
         return this.down('combobox').getValue();
     },
 
+    clearValue: function() {
+        this.down('combobox').clearValue();
+    },
+
     getName: function() {
         return this.name;
     },
--- a/app/view/widget/base/DateField.js	Mon Apr 20 11:13:29 2015 +0200
+++ b/app/view/widget/base/DateField.js	Mon Apr 20 11:15:25 2015 +0200
@@ -95,6 +95,10 @@
         return this.down('datefield').getValue();
     },
 
+    clearValue: function() {
+        this.down('datefield').clearValue();
+    },
+
     getName: function() {
         return this.name;
     },

http://lada.wald.intevation.org