简体   繁体   English

nattable单元格内的可点击文本

[英]clickable text inside a cell in nattable

We have just started implementing NatTable and we are very pleased by the performance increase we are seeing. 我们刚刚开始实施NatTable,而我们对看到的性能提升感到非常满意。 However, we are having trouble implementing a specific functionality. 但是,我们在实现特定功能时遇到了麻烦。

What we would like is to have clickable text inside a cell, which would then reference a row in the table which we select and bring into view. 我们想要的是在单元格中具有可单击的文本,然后该单元格将引用我们选择并显示在表中的一行。 Basically, something like: 基本上,类似:

Row # | Name # | Related links
--------------------------------------------------------------------------
Row 1 | Name 1 | Name 2 Name 3
Row 2 | Name 2 | Name 1
Row 3 | Name 3 | Name 1

By clicking on the text "Name 3" in the cell on Row 1, Row 3 would be selected. 通过Row 1, Row 3的单元格中单击文本"Name 3" ,将选择Row 1, Row 3

That is not a trivial task. 这不是一项琐碎的任务。 You will need to register a IMouseAction similar what we show in the latest version of Rendering_cells_as_a_link_and_button in the repository (part of the 1.6 development). 您将需要在存储库(1.6开发的一部分)中注册一个与最新版本的Rendering_cells_as_a_link_and_button中显示的类似的IMouseAction

But there the whole cell is used as a link. 但是,整个单元都用作链接。 You request a link inside a cell text, and maybe even multiple different links inside one cell. 您需要在单元格文本内请求链接,甚至可能在一个单元格内请求多个不同的链接。 That would mean your implementation would need to inspect the text inside the cell at the click position, and determine the action based on that. 这意味着您的实现将需要检查单元格内单击位置处的文本,并根据该文本确定操作。 As of now NatTable does not provide a solution for that and I have no solution for that either. 到目前为止,NatTable尚未提供解决方案,我也没有提供解决方案。 Probably some calculation with dynamic in-memory rendering to know that is rendered on the GC at the given click position. 可能需要进行一些动态内存渲染的计算,才能知道它是在给定的点击位置在GC上渲染的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM