This is a migrated thread and some comments may be shown as answers.

checkbox

2 Answers 22 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 28 Aug 2012, 06:10 AM
hiii,
I want to show checkboxes only for child nodes of a radtreeview that is I want to hide checkboxes for parent nodes,how i can do that?


regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 28 Aug 2012, 07:14 AM
Hi Sigma,

Try the following code snippet to achieve your scenario.

JS:
<script type="text/javascript">
    function Unclehood(sender, args) {
        var item = sender.get_nodes();
        for (var i = 0; i < item.get_count(); i++) {
            var node = item.getNode(i);
            if (node.get_level() == 0) {
                node.set_checkable(false);
            }
        }
    }
</script>

Hope this helps.

Regards,
Princy.
0
Sri
Top achievements
Rank 1
answered on 14 Nov 2016, 10:47 AM
 .CheckboxTemplate("# if (item.level() > 0) { #" +
                "<input type='checkbox' #= item.checked ? 'checked' : '' #>" +
            "# } #")
Tags
TreeView
Asked by
Sigma
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Sri
Top achievements
Rank 1
Share this question
or