Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

How to always show opener in TreeGrid

$
0
0
I'm trying to build a dynamic tree with TreeGrid. I use setData(Tree) on the TreeGrid, and then call add(TreeNode, parentPath) on the Tree to populate the nodes.

When a node is first added to the Tree, I have setIsFolder(true), so when the node is displayed there is an opener (+) shown in front of the node folder icon, even there are no children nodes added under it, which is expected, since I will add children in the TreeGrid's FolderOpenedHandler.

Now in the TreeGrid's FolderClosedHandler, I need to remove all the children nodes under the node to be closed. The node is closed, it's still displayed as a folder, but the opener disappears. And the folder can still be opened with double click. I guess it's because all its children have been removed, but I want it to be the same as when it's first added - an opener is shown just because isFolder is true even no children exist.

I tried to even remove the node itself and add it again with isFolder as true, but still no opener displayed.

Viewing all articles
Browse latest Browse all 4756

Trending Articles