Checkbox when selecting node

2 posts, 1 answers
  1. OfficeHeart
    OfficeHeart avatar
    99 posts
    Member since:
    Aug 2008

    Posted 28 Jan 2014 Link to this post

    Hello,

    I like the checkbox functionality in the treeview. Is it possible to check the checkbox when selecting a node and behave the CheckChildren.

    Thanks,
    Martin
  2. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 28 Jan 2014 Link to this post

    Hello Martin,

    You can set the checked field of the dataItem and it will trigger the checkChildren functionality. Here is the code that checks the nodes whenever an item is selected:

    $("[data-role=treeview]").data("kendoTreeView")
        .bind("select", function(e) {
            var dataItem = this.dataItem(e.node);
            dataItem.set("checked", true);
        });

    Regards,
    Alex Gyoshev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top