PDA

View Full Version : How do i get filter item on grid



keskpeart
16 Mar 2015, 6:20 AM
hello,
I can use the below code to get a list of Items on my grid.


grid.view.headerCt.getMenu().items.items;

The items I get are Ascending, Descending and Column. However there is also a string filter item which is not part of the list of items returned.

My question is how do i get the filter item?

yeghikyan
16 Mar 2015, 8:28 AM
What about fiddle code?

keskpeart
16 Mar 2015, 9:18 AM
Hello,

Thanks for responding here is the link for a fiddle, I also included some comments to further explain the issue
Link: https://fiddle.sencha.com/#fiddle/jlr

keskpeart
16 Mar 2015, 9:11 PM
My main motivation for wanted to get the filter item was to update its href tag. In order to achieve this goal I change my approach, instead of getting the item i used inheritance by extending the filter and overwrote the createMenuItem method. The fiddle was updated to show the changes


Ext.define('app.grid.filters.Filters', { extend : 'Ext.grid.filters.Filters',
alias: 'plugin.appGridfilters',
pluginId: 'appGridfilters',

createMenuItem: function (menu, ownerGridId) {
var me = this,
item;
me.sep = menu.add('-');


item = menu.add({
checked: false,
itemId: 'filters',
href : 'javascript:void(0)',
text: me.menuFilterText,
listeners: {
scope: me,
checkchange: me.onCheckChange
}
});


return (me.menuItems[ownerGridId] = item);
}
});