Expand tree nodes whenever grid content navigated in filemanager

How to expand tree nodes whenever folder is navigated to childs

You can use ‘right’ and ‘left’ arrow keys to expand and collapse the folders.

If you want the File Manager to automatically expand any folder whenever a user selects or navigates to it, you can attach the related handler to the widget’s onFolderSelect event: http://webix.com/snippet/03d8d1fd

Thanks Helga for support.

How do we persist the folder open state when the file manager get refreshed

Hi,

If you are using soft updates ( just calling $$(“fm”).load(“data/url”) and each item has a consistent ID, the component will update only changed elements, so open state will be preserved.

In common case, it possible to use .getState API of tree widget to get open state before data reloading, and call setState to reapply state back

Thanks maksim, I am not using load, I am calling ajax post request to load data.

Could you please let me know if you have any samples to preserve the state of the tree like sample

I am calling ajax post request to load data.

Still, while you are not resetting the widget, and new data doesn’t contain explicit “open:false”, the update can go without altering the open state.

var data = webix.ajax().post("newdata.php");
tree.parse(data);