How do I collapse a treeView, to the root elements?
regards
ttmgybta
How do I collapse a treeView, to the root elements?
regards
ttmgybta
The DBtreeview bean has a function setExpandNode() with 2 arguments, the second is a boolean: true means expand and false collapse.
So for example to collapse rootnode with pk 3 you can do:
elements.yourTreeBean.setExpandNode([3], false);
I want to collapse all and not just one tree (leaf, branch).
How is that possible?
I don’t think there is one command to collapse the tree, so you should do it for each root node separately.
Just loop through your foundset of root nodes like this:
for (var i = 1; i <= _fs.getSize(); i++) {
elements.yourTreeBean.setExpandNode([_fs.getRecord(i).your_pk], false);
}
Where _fs is the foundset of root nodes and your_pk the primary key field of your table.
I thought so there is no method to collapse them all at once.
That’s exactly what done in the meantime, the loop through my foundset.
And it works fine.
Thanks
ttmgybta from Davos