TreeView expandTo not working

2 posts, 0 answers
  1. Hwigyeom
    Hwigyeom avatar
    1 posts
    Member since:
    May 2014

    Posted 26 Dec 2017 Link to this post

    <!DOCTYPE html>
        <meta charset="utf-8"/>
        <title>Kendo UI Snippet</title>
        <script src=""></script>
    <div id="treeview"></div>
      loadOnDemand: false,
      dataSource: [
        { text: "foo", items: [
          { text: "bar", items: [
            { text: "baz" }
          ] }
        ] },
        { text: "one", items: [
          { text: "two", items: [
            { text: "three" }
          ] }
        ] }
    var treeview = $("#treeview").data("kendoTreeView");
    var baz = treeview.dataItem(treeview.findByText("baz"));
    console.log('baz', baz);
    // expand all nodes up to "three"
    var three = treeview.dataItem(treeview.findByText("three"));
    console.log('three', three);

    When the id field is removed from the snippet, 'three' item in the expandTo call is not expanded.

    I remember that the above code worked fine in the 2015.1.422 version.

  2. Plamen
    Plamen avatar
    3079 posts

    Posted 26 Dec 2017 Link to this post


    In such scenarios we recommend having IDs that will make difference in the nodes and assure correct behavior as for example it is done in our documentation here.

    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top