bind treetable to property of list object

Hi,

I have a similar question to: http://forum.webix.com/discussion/2973. I have an array property (containing hierarchical data) in a list object, and on selection of list item I’d like a treetable to be populated with the contents of the item’s array property. Selection of a different list item should clear the treetable and re-populate it with the array from the new item. Ideally I’d also like reverse binding of any data edits made via the treetable.

I’ve tried to set this up with binding, syncing, and manually, and can’t get it to work any way. Manual setting of the treetable’s data property on list item selection does work (with treetable.clearAll() to refresh the treetable), but when I re-select a list item again, the treetable has lost the hierarchical data in the array (only shows level 1 items).

What’s the best way to establish this connection?

Thanks!

For above use-case you need to use the manual linking
The only tricky part, for data loading you need to use code like next

mytree.parse( webix.copy( listitem.data, "json") );

webix.copy is mandatory here, because tree component will deconstruct incoming data array and without copy operation you will not be able to load it second time.

Works perfectly! Thanks so much.