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

    Hi, 
    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
    Admin
    Daniel avatar
    2117 posts

    Posted 11 Dec 2014 Link to this post

    Hello,

    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;
         });
     });


    Regards,
    Daniel
    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