comparison app/override/StringFilter.js @ 1308:6075731bc4f1

Added column filter to orte grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 02 Feb 2017 16:43:53 +0100
parents
children
comparison
equal deleted inserted replaced
1307:152fca74a839 1308:6075731bc4f1
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */
8
9 Ext.define('Lada.override.StringFilter', {
10 override: 'Ext.ux.grid.filter.StringFilter',
11
12 validateRecord: function(record) {
13 if (this.dataIndex === 'gemId') {
14 var store = Ext.data.StoreManager.get('verwaltungseinheiten');
15 var item = store.getById(record.get('gemId'));
16 var comp = item.get('bezeichnung');
17 return comp.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1;
18 }
19 else if (this.dataIndex === 'staatId') {
20 var store = Ext.data.StoreManager.get('staaten');
21 var item = store.getById(record.get('staatId'));
22 var comp = item.get('staatIso');
23 return comp.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1;
24 }
25 else {
26 var val = record.get(this.dataIndex);
27 if(typeof val != 'string') {
28 return (this.getValue().length === 0);
29 }
30 return val.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1;
31 }
32 }
33 });

http://lada.wald.intevation.org