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

Autosync + Remote Data = RangeError: Maximum call stack size exceeded

3 Answers 262 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 20 Dec 2012, 01:20 PM
I have a treeview with a shared HierarchicalDataSource. 
I'm using binding to remote data like in the demo http://demos.kendoui.com/web/treeview/remote-data.html
I've enabled checkboxes and set autoSync on the DataSource to true.

When I click open a node, I get RangeError: Maximum call stack size exceeded
and the node doesn't open.

As an alternative, I tried manual syncing, but then only the root nodes that changed are send to the server, not the child nodes.

Is there an explanation/example somewhere on how to persist (checkbox) data with a treeview?
All the demos I can find are working with readonly data.

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 24 Dec 2012, 10:38 AM
Hello Roland,

Auto-syncing is not yet supported in the HierarchicalDataSource, and manual syncing is performed on a per-level basis (as you have found out). The way to persist the checked state depends on your scenario, but the manual syncing is usually the way to go.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Roland
Top achievements
Rank 1
answered on 24 Dec 2012, 04:40 PM
Hi,

Thanks for the answer.
Can you provide an example on how to manually sync a level other than the top?

Thanks,

Roland
0
Alex Gyoshev
Telerik team
answered on 25 Dec 2012, 07:51 AM
Hello Roland,

You can sync the child datasource of a node by calling its sync method through the children property, like this:

    // client-side object
    var treeview = $("#treeview").data("kendoTreeView");
    // node element
    var node = treeview.wrapper.find(".k-item:first");
    // node data item
    var dataItem = treeview.dataItem(node);
    // child datasource sync
    dataItem.children.sync();

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