PDA

View Full Version : Grid Filters


ktoole
03-25-2010, 04:50 PM
When I try to use grid filters I get an error that Ext.ux.grid.filter is not defined. I cannot find the grid filter .js files that they show on the Ext JS web site and that are in the examples folder in \valence-2.1\ext-3.1.0\examples\grid-filtering\grid-filter-local.js file. The files are:

<script type="text/javascript" src="../ux/gridfilters/GridFilters.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/Filter.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/StringFilter.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/DateFilter.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/ListFilter.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/NumericFilter.js"></script>
<script type="text/javascript" src="../ux/gridfilters/filter/BooleanFilter.js"></script>

Are they available to use and I am just missing them? Below is the code I am trying to use for the filters.

var filters = new Ext.ux.grid.GridFilters({
autoreload: false,
local: true,
filters: [{
type: 'string',
dataIndex: 'FKNAME'
},{
type: 'numeric',
dataIndex: 'FKCMP'
}]
});

richard.milone
03-30-2010, 12:56 AM
I think your path names to the filter js files are off. For Valence the path would be for example:

/extjs/examples/ux/gridfilters/filter/Filter.js

I haven't messed with grid filters myself so I'm not sure if this is your only problem, but try fixing those paths and try it again and let's see what happens.

ktoole
03-30-2010, 08:14 AM
That appears to have worked. Thanks Richard. For me the filters are a nice way of added "searches" without having to add the search code.