Hello Susan!
I took a look at the matter but I'm afraid a substantial development of the feature would need to take place before this can be achieved. If you are looking for means to get started, the component you should be extending is the
Ext.grid.filters.filter.List. You can start by trying to override it; in case you get it working the way you need you can then consider making an extension. But no matter which path you chose it would need quite fundamental changes in how the plugin works.
Here's how you could get started at overriding the component:
Ext.define('extended-listfilter', {
override: 'Ext.grid.filters.filter.List',
createMenuItems: function () {
var me = this,
menu = me.menu;
me.callParent(arguments);
// Save something to indicate the current state of the 'all' check item
// to know when it is changing in a setValue() call
me.checkAllChecked = false; // initially not checked
},
setValue: function () {
var me = this,
items = me.menu.items,
value = [],
changedAllCheckbox = false,
i, len, checkItem;
// logic to handle when 'all' is checked, or to uncheck 'all' if any member is unchecked
// if the checked item was not "all", then proceed with normal "set value" for the filter
if (!changedAllCheckbox) {
me.callParent(arguments);
}
}
});
You can check how the original codes work to get hints on how you could manipulate it if you step into these
me.callParent()
calls with your JavaScript debugger.
Inspecting the
setValue()
method may also hint you in even easier ways to just check everything "from outside" if you'd rather just create a button to check everything from a grid panel's click (bear in mind the menu is only written once the menu is expanded the first time so some parts of the component may be absent if the button is clicked before the menu is expanded once).
I hope this helps, and sorry I couldn't put up a simple code showing you how to do this in its entirety; I tried a couple alternatives but all them turned out to be too complex to be finished in a timely manner.