Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Enable/Disable some nodes on load.

$
0
0

Hi,

I have the following code that runs on the check event of the Kendo TreeView CheckBox. If the node is checked, it disables and unchecks all of its children nodes. If the node is unchecked, it simply enables the children. I would like to perform similar functionality in the document.ready section, where I need to go over all the tree nodes, and disable all children of any checked node. While it seems simple, I cannot wrap my head around the right traversal method for this to work.

Please advise.
Thanks.
Alex.

 

functiononCheck(e) {
 
    varchbx = $(e.node).find('.k-checkbox input').filter(":first");
    varstate = chbx.is(':checked');
 
    if(state) {
        $(e.node).find(".k-group input").prop('checked', false);
        $(e.node).find(".k-group input").prop('disabled', true);
 
    } else{
        $(e.node).find(".k-group input").prop('disabled', false);
 
    }
}

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>