0

I Have a TreeView with ShowCheckBox(true). How can get all values of checked nodes in second level with JQuery.

1 Answer 1

1

This is about jQuery selectors:

To retrieve the values of the checked checkboxes only for the second level as array you can use the following line of code.

var array = $('#TreeViewName>ul>li>ul>li>div :checked').map(function(){ return this.value});

To get the text of a node or the value you should use the corresponding method - getItemText or getItemValue

There are example in the documentation :

var treeview = $('#ProductsTreeView').data('tTreeView');
var nodesSecondLevel= $("#TreeView1>ul>li :has(>div :checked)");
var arrayOfValue = nodesSecondLevel.map(function(){
    return treeview.getItemValue(this);
})
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, But I want value of node not checkbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.