PDA

View Full Version : How to create Grid Local filtering?



abondili
27 Jun 2013, 10:41 PM
I have an application with a Grid in it with lots of records. I just wanted to create a search box to filter the grid based on the search criteria. I have seen that there are some UX classes available for it. But I don't know how to integrate those classes in the app and make use of them. It would be more helpful if I have filtering like in the example given in the Sencha Examples.

Thanks in Advance.

blade226
28 Jun 2013, 3:52 AM
I tried it so:


// configure whether filter query is encoded or not (initially)
var encode = false;
// configure whether filtering is performed locally or remotely (initially)
var local = true;
var filters = {
ftype: 'filters',
// encode and local configuration options defined previously for easier reuse
encode: encode, // json encode the filter query
local: local, // defaults to false (remote filtering)
// Filters are most naturally placed in the column definition, but can also be
// added here.
filters: [
{
type: 'boolean',
dataIndex: 'visible'
}
]
};
and in the grid for example:

{header:"CM-Sachgebiet",dataIndex:"sachgebiet", hidden:true,
filter: {
type: 'string'
}},
{text:"Casemanager",dataIndex:"cm", hidden:true,
filter: {
type: 'string'

}},