0
votes

I have been using gridfilters plugin for my table to be displayed. At the moment I am applying a custom remote filter whenever the column menu's filter is changed, triggered by a "filterchange" event. On the main ViewPort:

xtype: 'gridpanel',
        title: 'Autopilot Monitor',
        titleAlign: 'center',
        store: 'AutopilotQueueStore',
        id: 'grid',
        plugins: 'gridfilters',
        maxRows: 20,
        selModel: {
            selType: 'cellmodel',
            mode: 'SINGLE'
        },
        listeners: {
            filterchange: 'onFilterChange'
        },

Whenever I fill the filter's menu fields, the filterchange event is called and the filter is applied. At the same time, when the field is filled, the menu checkbox for the filter is checked. Although, no event is called (not even filterchange) when I uncheck the filter menu checkbox.

I need to catch an event to be called whenever the checkbox's status is changed (checked or unchecked). How can I manage to do it? My controller:

onFilterChange: function (store, filters, e) {
    console.log(checkbox);
    var store = Ext.getStore('AutopilotQueueStore');
    var cmp = Ext.getCmp('id');
    Ext.override(Ext.grid.filters.Filters, { filterCls: Ext.baseCSSPrefix });
    store.clearFilter();
    var filter = filters[0];
    var txt = ""
    Ext.getCmp('filterTextField').setValue("");
    if (filter != undefined) {
        store.getProxy().extraParams = {
            filterColumn: filter.getValue() + "," + filter.getProperty(),
            filter: ''
        }
    }
    else {
        store.getProxy().extraParams = {
            filterColumn: txt,
            filter: ''
        }
    }
1

1 Answers

0
votes

You can get this event using other listeners, you can use filteractivate to fire when the user activates ( or checks the checkbox ) the filter, and filterdeactivate when the user deactivates ( or unchecks the checkbox) the filter