PDA

View Full Version : Extract values from filters header columns Extjs4



Ari0n
7 Oct 2013, 9:21 AM
I have filters on the columns, some are textfields and the others are combos, I need to extract all the values ??of these filters using a button located on the top of the grid. How I can extract the values ??of the columns of all the filters?

Ary_Fortune
7 Oct 2013, 10:06 AM
Since you have mentioned 'column', means you have a grid, is what I assume.
In that case, on the click of your button, try to access the gridObject, this grid obj should then give you metadata or data of the grid. The grid also gives you store object.

All the data on the page is available in some object on the page. Try to access the same.

you can take help from the console of the browser to debug. Hope it helps.

Ari0n
7 Oct 2013, 11:13 AM
Thanks for reply.

Yes is a grid, i have the object of the grid on event click:



console.log(Ext.create('DD.view.MYGRID').columns[1].items.value);

But when the result appear show me null.

If i have this:



Ext.define('DD.view.MyView' ,{
extend: 'Ext.grid.Panel', alias : 'widget.list', title : 'MDM', store: store,
width : 500, columnLines: true, //selModel: sm, columns : [
{header: 'col1',
editor: {xtype: 'textfield'},
items: {xtype: 'combo',
typeAhead:true,
mode: 'remote',
store:storeCuentasNivelCeroFnc(0),
listeners: {change:setFiltersCombo(object,eventObject){ alert(object.value)
}}} },
]
}
The combo event change show me an alert with the correct value but i need get the values of all filters when the event click of the button is trigger on.
Thanks