3
votes

I have two grids, thay both have one store. I need to show everything in first store, and special data from this store in second.

Example: First store shows every record, second store shown records with type = 12. How can I do filtering in grid, not in store. I need TWO different grids, not one with filtering.

If I will filter records in second grid by store, thay will hide in first. I will see it at the same time, and I need to see different data in them at the same time. And I need only one store.

1

1 Answers

10
votes

One good way is to override the method getRowClass() of GridView object in second grid:

    var secondGrid = new Ext.grid.GridPanel({
       //..
       viewConfig: {
            getRowClass: function(record, index) {
                if (record.get('type') != '12') {
                    return 'display-false';
                } 
            }
        }
    });

Also you should define a CSS class:

.display-false { display: none }

Try this solution!