How to retain value of tree view after performing reset

2 posts, 0 answers
  1. PL
    PL avatar
    2 posts
    Member since:
    Sep 2014

    Posted 09 Dec 2014 Link to this post

    I have used tree view on one of my edit page. On page load tree view shows 2 nodes and their children as checked out of 5 nodes. I want to retain these 2 checked nodes with children after reset action. On UI I can see 2 nodes and their children as checked after reset but at script level some how model containing value of tree node becomes empty. How to retain this model value at script level?
  2. Daniel
    Daniel avatar
    2173 posts

    Posted 11 Dec 2014 Link to this post


    Could you clarify what you mean by model containing value becomes empty? If you are referring to the nodes checked field then you could update the values in the form reset event as in the snippet below:
    $("form").on("reset", function (e) {
         var treeview = $("#treeview").data("kendoTreeView");
         treeview.element.find(":checkbox").each(function () {
             var item = treeview.dataItem(this);
             item.checked = this.defaultChecked;

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top