jstree select element which contains exact string
I must check some nodes of my jstree (checkbox plugin) on page load
$j("#tree_data").jstree("check_node",'a:c开发者_开发知识库ontains('+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".
solved
$j("#tree_data").jstree("check_node",$j("a:contains("+tool_name+")").filter(function() {
return $j(this).parent().contents().last().text().trim() == tool_name;}));
精彩评论