如何从GWT中的CellTree中获取选定项目的路径

问题描述:

我有一个 CellTree ,其中包含一个组织列表。在模型中,每个家长都包含一个孩子的列表。
有没有简单的方法来获取选定项目的路径?或者我必须通过遍历树和通过id查找来使用通常的方法。

I have a CellTree containing a list of organisations. In the Model, each parent contains a list of a children. Is there an easy way to get the path of a selected item ? or I have to go with the usual methode by iterating through the tree and lookup by id.

谢谢

Thanks

CellTree本身没有任何内置功能来检索所选项目的路径。

您必须手动遍历树形结构以获取路径。您可以使用递归函数来检索路径。我做了类似的事情,但为了不同的目的(以编程方式打开CellTree中的节点)。

The CellTree itself does not have any built-in functionality to retrieve the path for the selected item.
You will have to manually traverse through your tree structure to get the path. You can use a recursive function to retrieve the path. I have done something like that but for a different purpose (programmatically opening nodes in a CellTree).