# HG changeset patch # User Dustin Demuth # Date 1429521325 -7200 # Node ID 4031b9aa8d8336b0f562a8cac8e5d11fb51e97d3 # Parent 47de91fb03bbbd849af03af989a4e98f74839a00# Parent 7ae9599bee39e6ac97cf06d766574e7d5bce3659 merged heads diff -r 7ae9599bee39 -r 4031b9aa8d83 .hgtags --- 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 diff -r 7ae9599bee39 -r 4031b9aa8d83 app/controller/Filter.js --- 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() { diff -r 7ae9599bee39 -r 4031b9aa8d83 app/view/widget/base/ComboBox.js --- 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; }, diff -r 7ae9599bee39 -r 4031b9aa8d83 app/view/widget/base/DateField.js --- 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; },