Why treetable structure with expand-collapse nodes are destroyed if parse function is used?

Hi,

I am showing a tree structure and plain datatable by separate button click.
If I use table.parse, then the expand-collapse node and the tree structure is lost when I switch buttons.

If I use table.define(‘data’ , webix.copy(dataset)), then the tree structure retains even after switching buttons.
Because of webix.copy , the original reference to the dataset is getting lost and this is causing some problem for me.

Snippet: https://snippet.webix.com/qbpbdivz

How can I retain the tree structure without losing the original data reference.

Thanks.

Hello,

Did you try this?
https://snippet.webix.com/6psmdgj8

Hi Nastja,

It is working, however it still does webix.copy(data) which loses the original reference of the data.

Problem is, I am holding the entire table data in a global variable. If I edit any cell in the treetable structure, the global variable gets automatically updated with that change and thus saving it to database becomes easier.

With this webix.copy I am losing that change and it requires me to do lot of post processing by reading table.data.pull before saving it.

Thanks.