英文:
Issue while row hiding in Group By Nattable
问题
我正在使用一个带有表示不同对象的行的nattable,包括分组对象和另一个对象。
当我尝试隐藏第302行,表示一个对象时,它被如预期地隐藏了。然而,看到第303行存在问题,它代表一个分组对象。具体来说,分组对象的标签似乎仍然可见,但在第303行之后的行重复显示相同的分组对象。
我使用以下代码:
bodyDataLayer = new GroupByDataLayer<>(groupByModel, GlazedLists.threadSafeList(GlazedLists.eventList(data)), columnPropertyAccessor, configRegistry);
this.bodyDataProvider = (ListDataProvider) bodyDataLayer.getDataProvider();
GlazedListsEventLayer glazedlist = new GlazedListsEventLayer<>(bodyDataLayer,
((GroupByDataLayer<T>) bodyDataLayer).getTreeList());
dataChangeLayer = createDataChangeLayer(rowIdAccessor, bodyDataProvider, glazedlist);
columnReorderLayer = new ColumnReorderLayer(dataChangeLayer, columnReorderDefaultConfig);
columnHideShowLayer = new ResizeColumnHideShowLayer(columnReorderLayer, bodyDataLayer);
RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(columnHideShowLayer);
是否有解决这个问题的方法?帮助将不胜感激。谢谢!
英文:
I am using a nattable with rows that represent different objects, including group by objects and an another objects.
When I tried to hide row number 302, which represents an object, it is being hidden as expected. However, seeing an issue with row 303, which represents a group by object. Specifically, it seems that the group by object label is still visible, but the rows after row 303 are repeating the same group by object.
Im using the following code :
bodyDataLayer = new GroupByDataLayer<>(groupByModel,GlazedLists.threadSafeList(GlazedLists.eventList(data)), columnPropertyAccessor,configRegistry);
this.bodyDataProvider = (ListDataProvider) bodyDataLayer.getDataProvider();
GlazedListsEventLayer glazedlist = new GlazedListsEventLayer<>(bodyDataLayer,
((GroupByDataLayer<T>) bodyDataLayer).getTreeList());
dataChangeLayer = createDataChangeLayer(rowIdAccessor, bodyDataProvider, glazedlist);
columnReorderLayer = new ColumnReorderLayer(dataChangeLayer, columnReorderDefaultConfig);
columnHideShowLayer = new ResizeColumnHideShowLayer(columnReorderLayer, bodyDataLayer);
RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(columnHideShowLayer);
Is there any way to resolve this issue. Help would be appreciated. Thanks!
答案1
得分: 1
问题在于您正在使用RowHideShowLayer
,它通过行索引隐藏行。这在与GlazedLists的功能(如GroupBy)组合使用时不起作用。为此,您需要使用GlazedListsRowHideShowLayer
,它通过行对象ID隐藏行。
示例用法可在NatTable示例应用程序中找到,位于教程示例 - GlazedLists - GlazedListsRowHideShowExample或教程示例 - 集成 - EditableSortableGroupByWithFilterExample中。
英文:
The problem is that you are using the RowHideShowLayer
which hides a row by row index. This is not working correctly in combination with GlazedLists features like GroupBy. For this you need to use the GlazedListsRowHideShowLayer
which hides rows via row object ids.
The usage is shown in the NatTable Examples Application in Tutorial Examples - GlazedLists - GlazedListsRowHideShowExample or in Tutorial Examples - Integration - EditableSortableGroupByWithFilterExample.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论