Tree

Hi, I am using the tree. Actually, 2 trees on the same page. I followed the documentation rules and load data as

tree1.parse(tree_data);
tree2.parse(tree_data).

The problem is that the first tree displays the data correctly but the second tree displays just the top-level items as I loaded only them.

Could you suggest me how to fix it?

Thanks

Hi, Mateo.

You need to use something like this:

tree1.parse(tree_data);
tree2.parse(webix.copy(tree_data));

It's wrong to use one data for different components, you need doing copies of this data.
Also you can use webix DataCollection for storing data and syncronize this data with different components.

Thank you! It works!
Could you give me the link where I’ll read about data collections? I couldn’t find it by myself.

In Articles by link you find all needed information about DataCollection.

http://docs.webix.com/search.php?query=datacollection

Got it! Thanks