我有两个网格,都有一个商店。 我需要在第一家商店展示一切,并在第二家店展示特殊数据。
示例:第一个商店显示每条记录,第二个商店显示类型= 12的记录。如何在网格中进行过滤,而不是在商店中进行过滤。 我需要两个不同的网格,而不是一个过滤。
如果我会按商店筛选第二个网格中的记录,那么它会先隐藏起来。 我将同时看到它,并且我需要同时看到它们中的不同数据。 我只需要一家商店。
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.
最满意答案
一种好的方法是在第二个网格中重写GridView对象的getRowClass()方法:
var secondGrid = new Ext.grid.GridPanel({ //.. viewConfig: { getRowClass: function(record, index) { if (record.get('type') != '12') { return 'display-false'; } } } });你也应该定义一个CSS类:
.display-false { display: none }试试这个解决方案
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!
更多推荐
发布评论