Hello Isomorphic!
According to Tree setRoot() method javadoc, "If you're using the "parent" modelType, you can provide the root node configuration via this property."
I need to construct a tree in parent mode, but adding children one by one.
So, first of all I set the root using
then I add children using
When system renders the gui, the tree has not the specified node as root, but the first child added.
Filtering too does not work, excluding the root node, see the attachment.
If I want to have the specific node as root, I have to invoke
and then adding the children.
Is this the expected behaviour of setRoot() method? Am I wrong or misunderstanding the api?
Thanks in advance for the answer.
PS: invoking setShowRoot() on both Tree and TreeGrid visually fixes "the problem", but filtering still returns 2 nodes rather than 3 as expected, the excluded node is the root. The second approach allows correct filtering, it returns 3 nodes.
According to Tree setRoot() method javadoc, "If you're using the "parent" modelType, you can provide the root node configuration via this property."
I need to construct a tree in parent mode, but adding children one by one.
So, first of all I set the root using
Code:
setRoot(TreeNode root)
Code:
tree.add(child, parent, position).
Filtering too does not work, excluding the root node, see the attachment.
If I want to have the specific node as root, I have to invoke
Code:
tree.setData(new TreeNode[]{p1});
Is this the expected behaviour of setRoot() method? Am I wrong or misunderstanding the api?
Thanks in advance for the answer.
PS: invoking setShowRoot() on both Tree and TreeGrid visually fixes "the problem", but filtering still returns 2 nodes rather than 3 as expected, the excluded node is the root. The second approach allows correct filtering, it returns 3 nodes.
Comment