How to hide rows in ExtJS GridPanel

In my system, I want to hide certain rows of the GridPanel depends on the value of a column. Luckily, it’s easy to do with store’s filterBy method of the GridPanel.

var store = new Ext.data.GroupingStore({
        reader: new Ext.data.JsonReader({fields: Module}),
        data: generateData(),
        sortInfo: {field: 'codename', direction: 'ASC'},
        groupField:'registered'
    });
 
    store.clearFilter();
    store.filterBy(function(record, id){
        // will hide row if there's no config file
        if (record.data.has_config) return true;
        else if (record.data.registered) return true;
        else return false;
    });

Related posts:

Share

About number.0