PDA

View Full Version : [3.1.0] how to get the filters in gridfilters



axelaxel
6 May 2010, 6:53 AM
Hi guys, a simple question
i have a grid, and i use as plugin a gridfilter, to get easily filters on rows, inserting filters on columns.
this is done.

this is the plugin:


var filterPlugin = new Ext.ux.grid.GridFilters({
encode: false,
local: true
});


and this is the code of the grid:


var categoryGridConfig = {
id: 'categoryGrid',
selModel: new Ext.grid.RowSelectionModel({singleSelect: true}),
frame: false,
stripeRows: true,
border: true,
autoWidth: true,
header: false,
loadMask: true,
enableColumnMove: false,
enableColumnHide: false,
enableHdMenu: true,
clicksToEdit: 1,
region: 'center',
plugins: [filterPlugin],
store: mainGridStore,
// attenzione se si aggiungono/rimuovono colonne alla tabella!
// E' necessario cambiare gli indici di colonna nella funzione isCellEditable()
columns: columnsMainGrid,
........




my problem is, how can i get the values i insert in my filters?
i mean, if in the colum product_name i set the filter "CA" to get cars and caterpillars, how can i do to get as result "CA" ? because i cannot find a way to get them, and even using Firebug, i checked the grid, the column model, the filters, but i wasn't able to find those kind of values.

thank you very much



axel

axelaxel
6 May 2010, 7:01 AM
This works



Ext.getCmp('categoryGrid').filters.filters.items[x].getValue();



where "x" is the column ID
but is there a smarter method?


thank you

Nesta
6 May 2010, 8:46 AM
have a look at the filtergrid thread in the ux part of the forum
filters provide a getState() function

[EDIT]
Looking into the docs i found getFilterData
http://extjs-ux.org/ext-docs/?class=Ext.ux.grid.GridFilters

(http://extjs-ux.org/docs/index.html?class=Ext.ux.grid.GridFilters)