PDA

View Full Version : Simple ExtJS 4 grid filterfeature



harman
18 Jun 2012, 12:20 AM
Hi All,

I am using ExtJS 4.0.7 Grid.
For one of the columns i want to provide a simple filter(String) feature.
What steps do i need to take and what file do i need to import?
I tried many things but the feature does not appear in the column headers.

I did



Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.ux.grid.FiltersFeature',
]);

var filtersCfg = {
ftype: 'filters',
autoReload: false,
local: true,
filters: [
{
type: 'string',
dataIndex: 'index1'
}
]
};

var grid = Ext.create('Ext.grid.Panel', {
autoScroll: true,
store: gridStore,
id: 'gridTest',
columnLines: true,
disableSelection: true,
loadMask: true,
border:false,
frame: false,
filters: [filtersCfg],

columns:[


id : Ext.id(),
text: "Something",
dataIndex: 'index1',
flex: 1,
align : 'center',
sortable: true,
filterable:true,
renderer: checkType
}]
});



What else do i need to do?
Or
Do i miss something?

scottmartin
18 Jun 2012, 8:20 AM
Add the following at the top:
Ext.Loader.setPath('Ext.ux', 'extjs/examples/ux'); // your path to extjs

Scott.