在Group By Nattable中隐藏行时出现问题。

huangapple go评论55阅读模式
英文:

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.

在Group By Nattable中隐藏行时出现问题。

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.

在Group By Nattable中隐藏行时出现问题。

Im using the following code :

bodyDataLayer = new GroupByDataLayer&lt;&gt;(groupByModel,GlazedLists.threadSafeList(GlazedLists.eventList(data)),    columnPropertyAccessor,configRegistry);

this.bodyDataProvider = (ListDataProvider) bodyDataLayer.getDataProvider();

GlazedListsEventLayer glazedlist = new GlazedListsEventLayer&lt;&gt;(bodyDataLayer,
					((GroupByDataLayer&lt;T&gt;) 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.

huangapple
  • 本文由 发表于 2023年3月31日 19:04:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75897805.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定