最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ExtJS:: How to filter rows in grid, but not in store - Stack Overflow

programmeradmin3浏览0评论

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.

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.

Share Improve this question asked Apr 6, 2012 at 8:57 nkuhtankuhta 11.2k12 gold badges45 silver badges55 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

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!

发布评论

评论列表(0)

  1. 暂无评论