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

[Solved] Select parent node on selecting child node and vice versa

0 Answers 27 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
GOPI S
Top achievements
Rank 1
GOPI S asked on 28 Dec 2012, 05:56 AM
Hi,
I am new to mvc, i am using Check-box inside the tree view and i am trying to implement 2 things
1)When i have selected parent node all the child node need to be selected.
2)When we check any one of the child node it's related parents also need to be checked.

As of now, i have implemented 1 st alone using the code below

function onChecked(e) {
 
                var item = $(e.item);
                var isChecked = e.checked;
                var childCheckBoxes = item.find(":checkbox");
                var treeView = $('#ServiceProvidersTree').data('tTreeView');
                treeView.expand(e.item);
                       $.each(childCheckBoxes, function (index, checkbox) {
                        $(checkbox).attr('checked', isChecked);
                        treeView.nodeCheck(checkbox, isChecked);
                    });
            }

I have searched to implement the 2nd but no use? can u help me in this ..
Thanks in advance
Tags
TreeView
Asked by
GOPI S
Top achievements
Rank 1
Share this question
or