Treeview checked parent node

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

    Posted 18 May 2014 Link to this post

    Hi, 
    I´m trying to use a treeview with checkboxes for definition User Rights. (2 actions - enabled/disabled right)
    How can I to get value (id) from parent node ?

    I attached an example what I need.
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 19 May 2014 Link to this post

    Hello Stano,

    Do you need the indeterminate nodes to be treated as checked, or do you need the checked state to be persisted when the child nodes are unchecked? For the first case, the following snippet will get you the IDs of the indeterminate nodes:

    var tree = $("#treeview").data("kendoTreeView");
    tree.element.find(":checkbox")
        .filter(function() { return this.indeterminate; })
        .map(function() { return tree.dataItem(this).id; });


    For the second case, here is a Dojo snippet that shows this.

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. blackhawk
    blackhawk avatar
    2 posts
    Member since:
    May 2014

    Posted 19 May 2014 in reply to Alex Gyoshev Link to this post

    thx for answer, I need the checked state to be perists when the child nodes are unchecked.
    Thanks for example but still is not ok.
     I need checked all parent nodes when I checked QUX in tree. I need combination original demo example with this example what do you sent

    When I checked Parent nodes  I need automatically checked Children.
    When I checked Child nodes I need automatically checked Parents.
    When I have checked all children and i unchecked one of the children a I need the checked state of parent nodes for this children to be persist.







  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 19 May 2014 Link to this post

    Hello Stano,

    This functionality is not supported out of the box. The provided code snippet allows you to gather the indeterminate checkboxes and get the IDs of their data items, so you can process them as necessary.

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready