comparison app/controller/Filter.js @ 810:a5373ee662e2

Created a loading Animation for the Filterresultgrid
author Dustin Demuth <dustin@intevation.de>
date Wed, 27 May 2015 16:01:59 +0200
parents 4b9b1d3ad9f1
children 1449d58d6f58
comparison
equal deleted inserted replaced
809:3bc19188fc3a 810:a5373ee662e2
217 var store = Ext.StoreManager.lookup(sname); 217 var store = Ext.StoreManager.lookup(sname);
218 if (!store) { 218 if (!store) {
219 store = Ext.create(sname); 219 store = Ext.create(sname);
220 } 220 }
221 if (store) { 221 if (store) {
222 store.addListener('beforeload', this.loadingAnimationOn, resultGrid);
223 store.addListener('load', this.loadingAnimationOff, resultGrid);
222 resultGrid.setStore(store); 224 resultGrid.setStore(store);
223 resultGrid.setupColumns(this.displayFields); 225 resultGrid.setupColumns(this.displayFields);
224 resultGrid.getStore().proxy.extraParams = searchParams; 226 resultGrid.getStore().proxy.extraParams = searchParams;
225 resultGrid.getStore().load(); 227 resultGrid.getStore().load();
226 resultGrid.show(); 228 resultGrid.show();
227 } 229 }
228 }, 230 },
231
232 /**
233 * Enable the Loading Animation of the Grid.
234 */
235 loadingAnimationOn: function(store, operation) {
236 // this = resultgrid because of the scope which was set in addListener
237 this.setLoading(true);
238 },
239
240 /**
241 * Disable the Loading Animation of the Grid.
242 */
243 loadingAnimationOff: function(store, operation) {
244 // this = resultgrid because of the scope which was set in addListener
245 this.setLoading(false);
246 },
247
229 /** 248 /**
230 * This function resets the filters 249 * This function resets the filters
231 */ 250 */
232 reset: function(element) { 251 reset: function(element) {
233 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]'); 252 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');

http://lada.wald.intevation.org