【问题标题】:How to restore selection in nattable after nattable refresh?nattable 刷新后如何恢复 nattable 中的选择?
【发布时间】:2020-04-07 12:09:57
【问题描述】:

使用 -nattable.doCommand(新的结构刷新命令()) -nattable.refresh()

现在我想在 nat 表中保留选择

当我使用- natpage.selectionProvider().getSelection();刷新后选择不再可用

如何在 natable 中保留选择,以便用户可以多次更新同一选定行?

【问题讨论】:

    标签: eclipse nattable


    【解决方案1】:

    使用natTable.refresh(false),因为听起来您不会更改底层数据模型的结构,因此不需要进行结构刷新。

    您还可以在这里查看更多信息: NatTable preserve row selection on clear data and reload

    【讨论】:

    • 谢谢它在底层数据模型的结构没有改变的情况下工作。
    • 但是有没有办法在两者之后保留选择
    • natTable.doCommand(new StructuralRefreshCommand()) 和 natTable.doCommand(VisualRefreshCommand()),不使用 PaintListener
    • 即使在使用 natTable.refresh(false) 之后,选择在对列进行排序时也会丢失?
    • 您可以尝试使用 RowSelectionModel 或 PreserveSelectionModel。使用这些模型,可以根据行 ID 恢复选择。
    猜你喜欢
    • 2016-09-21
    • 1970-01-01
    • 2014-08-29
    • 2021-12-05
    • 1970-01-01
    • 2020-02-18
    • 1970-01-01
    • 2022-06-17
    • 2017-02-26
    相关资源
    最近更新 更多