views:

98

answers:

1

I must check some nodes of my jstree (checkbox plugin) on page load

$j("#tree_data").jstree("check_node",'a:contains('+tool_name+')');

but if tool_name = "aa" all nodes abaa, aaa, blaah will be checked. I need to check only the node that contains exactly "aa".

A: 

solved

$j("#tree_data").jstree("check_node",$j("a:contains("+tool_name+")").filter(function() {
        return $j(this).parent().contents().last().text().trim() == tool_name;}));
Bohdan Pohorilets