Force load and expand of node with LoadOnDemand(true)

2 posts, 0 answers
  1. Paul
    Paul avatar
    9 posts
    Member since:
    Feb 2014

    Posted 16 Mar 2014 Link to this post

    I'm trying to force the load and expand of a node when using LoadOnDemand. I've seen several examples of this in the forums, but I can't get it to work. This is my code:

    var tv = $("#FolderTree").data('kendoTreeView');
    var selectedItem = tv.dataItem(;
    var selectedDataItem = tv.dataItem(tv.findByUid(selectedItem.uid));

    The children are being retrieved from the server, but the node is not expanded and the children of the node (which I'm trying to access) are not available in the datasource.

    Why is the node not expanding?

    Thanks in advance.
  2. Dimo
    Dimo avatar
    8407 posts

    Posted 19 Mar 2014 Link to this post

    Hi Paul,

    You are trying to expand a Kendo UI Model instance (selectedItem), while the expand method expects a DOM element, a jQuery object or a selector string.

    On a side note, you don't need to execute the load() method explicitly. Expanding a node will load it automatically if needed.


    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Back to Top