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

TreeView not calling CREATE method for newly appended node

4 Answers 38 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Z
Top achievements
Rank 1
Z asked on 13 Jan 2015, 11:31 PM
When a new node is appended to root, the HierarchicalDataSource correctly calls my remote CREATE method:

var tv = $('#outlineEdit').data('kendoTreeView');
tv.append({ text: 'test', parentId: 6}, null);
me.outlineTreeDataSource.sync();

However, when the node is appended to a parent node, no call is ever made to the remote server but the node is visually appended.  

var tv = $('#outlineEdit').data('kendoTreeView');
tv.append({ text: 'test', parentId: 6}, tv.findByText("Child 1.2"));
me.outlineTreeDataSource.sync();


I haven't found any example or documentation that shows how to do this 'correctly'.  Please advise!

4 Answers, 1 is accepted

Sort by
0
Z
Top achievements
Rank 1
answered on 13 Jan 2015, 11:36 PM
(This is using Kendo UI v2014.3.1119)
0
Alex Gyoshev
Telerik team
answered on 14 Jan 2015, 11:14 AM

Hello Zaryn,

You need to call the sync method of the child dataSource:

var tv = $('#outlineEdit').data('kendoTreeView');
var parentNode = tv.findByText("Child 1.2");
tv.append({ text: 'test', parentId: 6}, parentNode);
tv.dataItem(parentNode).children.sync();

 

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Z
Top achievements
Rank 1
answered on 14 Jan 2015, 05:49 PM
Ah!  Thank you :)

I think that would be very information to document on the HierarchicalDataSource page and the TreeView page!  It's not documented on either one currently, or in any of the examples.
0
Alex Gyoshev
Telerik team
answered on 16 Jan 2015, 11:29 AM

Hello Zaryn,

Indeed, synchronization of nodes is not well documented, and there are not any good examples on TreeView editing at this time. We have this on our to-do list for future releases.

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
TreeView
Asked by
Z
Top achievements
Rank 1
Answers by
Z
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or