PDA

View Full Version : ExtJS 3-4: GridFilters is not working with type 'date'



nvchien1407
13 Mar 2013, 3:09 AM
Hi all,

I found 6 types under ux/grid/filter/
StringFilter
NumericFilter
ListFilter
Filter
DateFilter
BooleanFilter

and my grid filter is working with 'string' and 'numeric' and 'list', but there is exception with 'date' and 'boolean' type. The exception is

TypeError: sp is undefined

spp = sp.prototype;at line 250 of my ext-base-debug.js and then when GridFilters try to add filter with type 'date'

GridFilters.js

.............
addFilter : function (config) {
var Cls = this.getFilterClass(config.type);
filter = config.menu ? config : (new Cls(config));
this.filters.add(filter);


Ext.util.Observable.capture(filter, this.onStateChange, this);
return filter;
},
.......................

the Cls is undefined, because the DateFilter is not initialized. But with filter type 'string', it does works. Can someone please look into this or did you face the same problem?

mitchellsimoens
15 Mar 2013, 12:17 PM
The custom grid filters example works (when you edit it to show the date column)

nvchien1407
16 Mar 2013, 3:21 AM
Thank Mitchell, I fixed my problem. This is because I included all the filters with this ux/grid/filter/**
then extjs load the filters in alphabetic order, firstly is Boolean and Date, but these two filter extends Filter (at this time Filter is not loaded). The problem is not happen with List, String and Numeric because they are loaded after Filter.

So my include command is
ux/grid/filter/Filter.js
ux/grid/filter/**

Cheers.