How to hide /show dynamically treeitem in sidebar view

Treeitem level 2 for example

Hi, @roma
With the expanded sidebar (collapsed: false property that is a value by default) you can use such tree methods as open() / close() .
To show an item you can find its parent by item’s id by getParentId(id) and then open its parent or all the parents up to first level by open(id, true).
Also, if there is a scroll in a tree / sidebar, you call use showItem(id) method to scroll right to the component.
Check the snippet: Code Snippet

ok understood, just the case which i face in is some tree child items which should not be visible, when some option is active.And for some cases need display it again. With other elements it is easy to achieve by simple use show/hide function.

Hello, @roma
There is no similar methods to show/hide that could be used with Sidebar. However, you can try filtering your data according to the specified rules to show only the data that you need. I would recommend to use TreeCollection in this case and filter the data in it so that the data would be shown properly when the sidebar is collapsed.
Please, check the snippet and the comments in it : Code Snippet