I am trying to create a complex filter for a grid. I want the following general behavior:
- The filters have a different store than the grid
- Apply filter on column A
- The grid is filtered based on my selection
- The filter in column B will show the available items
Also, the grid has a button that clears all the filters and more, remove the checked items from the filters.
Based on this link I've tried to do something similar. I've created also a fiddle.
Regarding the fiddle, I have some question:
1.The following code returns undefined. Based on the documentation it should return a Menu object.
business.filter.menu = business.filter.createMenu({
store: localStore
})
2.I want to clear the checked items when user press the Clear Inline Filter button.
var f = Ext.ComponentQuery.query('test-grid')[0].getColumnManager().getHeaderByDataIndex(element).filter;
if (f.menu) {
for (var j = 0; j < f.menu.items.length; j++) {
f.menu.items.items[j].setChecked(false)
}
}
Here the, f.menu is always undefined so I can't clear the checkbox. Somehow I lose reference to menu.
How to clear the checkboxes based on my scenario? Why the createMenu returns undefined?
Edit
The accepted answer worked for this specific question(fiddle)