This is a migrated thread and some comments may be shown as answers.

What is the correct way to save a node children?

1 Answer 37 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
Bassanio
Top achievements
Rank 1
Bassanio asked on 12 Feb 2014, 09:04 AM
Hello,

I have a Hierarchical Data Source and work fine for display in ListView.

I can also CRUD the root level without problem. However, I could not update the second level (node.children).

No mater tried node.children.sync(), or even the top <Hierarchical Data Source>.sync(), the update function of transport had not been triggered. 

I tried modify a child record: node.children.at(0).set('newKey', 'newValue'). node.children.hasChanges() retuned True. After node.children.sync(), node.children.hasChanges() retuned False. But Transport.update had not been triggered so that nothing was written into datasource.

Any idea?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 14 Feb 2014, 12:34 PM
Hello Bassanio,

See this jsBin sample for a simple example how to sync the TreeView upon editing. An important thing to note is that nodes need to have IDs in order for the update / destroy operations to work (items without IDs are considered as not synchronized). Thus, the create action needs to return the ID upon successful creation of items.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Hierarchical Data Source
Asked by
Bassanio
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or