comparison app/controller/Filter.js @ 742:6e28ebbe1a73

added documentation for Form and Grid controllers
author Dustin Demuth <dustin@intevation.de>
date Thu, 23 Apr 2015 16:28:04 +0200
parents 2d482dfaa41a
children 704bb359c0fe
comparison
equal deleted inserted replaced
740:2e8da590ea0c 742:6e28ebbe1a73
22 'ProbenList' // List of found Proben 22 'ProbenList' // List of found Proben
23 ], 23 ],
24 24
25 displayFields: null, 25 displayFields: null,
26 26
27 /**
28 * Initialize this Controller
29 * It has 4 Listeners
30 */
27 init: function() { 31 init: function() {
28 this.control({ 32 this.control({
29 // CSS like selector to select element in the viewport. See 33 // CSS like selector to select element in the viewport. See
30 // ComponentQuery documentation for more details. 34 // ComponentQuery documentation for more details.
31 'combobox[name=filter]': { 35 'combobox[name=filter]': {
70 desc.setValue(record[0].data.description); 74 desc.setValue(record[0].data.description);
71 75
72 // Setup Columns of the probenlist 76 // Setup Columns of the probenlist
73 this.displayFields.reverse(); 77 this.displayFields.reverse();
74 78
75 // Setup Filters of the probenlist 79 /* Setup Filters of the probenlist
76 // 80 *
77 // Allowed types are 81 * Allowed types are
78 // * text 82 * * text
79 // * number 83 * * number
80 // * datetime 84 * * datetime
81 // * bool 85 * * bool
82 // * listmst 86 * * listmst
83 // * listumw 87 * * listumw
84 // * listver 88 * * listver
85 // * listdbasis 89 * * listdbasis
86 // * listnetz 90 * * listnetz
87 // 91 *
88 // Iterate over all configured filters and add filters dynamically 92 * Iterate over all configured filters and add filters dynamically
89 // 93 *
90 // 1. Empty filters 94 * 1. Empty filters
95 */
91 filters.removeAll(); 96 filters.removeAll();
92 var hide = true; 97 var hide = true;
93 // 2. Iterate over all configured filters 98 /* 2. Iterate over all configured filters */
94 var j; 99 var j;
95 for (j = 0; j < filterFields.length; j++) { 100 for (j = 0; j < filterFields.length; j++) {
96 var type = filterFields[j].type; 101 var type = filterFields[j].type;
97 var name = filterFields[j].dataIndex; 102 var name = filterFields[j].dataIndex;
98 var label = filterFields[j].label; 103 var label = filterFields[j].label;
200 } 205 }
201 resultGrid.getStore().proxy.extraParams = searchParams; 206 resultGrid.getStore().proxy.extraParams = searchParams;
202 resultGrid.getStore().load(); 207 resultGrid.getStore().load();
203 resultGrid.show(); 208 resultGrid.show();
204 }, 209 },
205 210 /**
211 * This function resets the filters
212 */
206 reset: function(element) { 213 reset: function(element) {
207 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]'); 214 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');
208 for (var i = filters.items.length - 1; i >= 0; i--) { 215 for (var i = filters.items.length - 1; i >= 0; i--) {
209 var filter = filters.items.items[i]; 216 var filter = filters.items.items[i];
210 filter.clearValue(); 217 filter.clearValue();
211 } 218 }
212 }, 219 },
213 220 /**
221 * This Function is supposed to handle the About action
222 * It has no function yet.
223 */
214 about: function() { 224 about: function() {
215 var info = this.getInfoStore(); 225 var info = this.getInfoStore();
216 Ext.widget('about', { 226 Ext.widget('about', {
217 info: info 227 info: info
218 }); 228 });

http://lada.wald.intevation.org