add auto select one node
This commit is contained in:
parent
5178689bf4
commit
846648f424
|
@ -19,7 +19,7 @@ function jstreeCreateNode(containerId,data,name,id,pos){
|
|||
childNode = ref.create_node(parentNode,{text:name,id:id,data:data,type:"default"},pos);
|
||||
if(childNode) {
|
||||
ref.open_node(parentNode);
|
||||
ref.select_node(childNode);
|
||||
jstreeSelectNode(containerId,childNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,16 @@ function jstreeDeleteNode(containerId){
|
|||
return ref.element.context.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param containerId the id of jstree container
|
||||
* @param node the id of to be selected node
|
||||
*/
|
||||
function jstreeSelectNode(containerId,node){
|
||||
var ref = $("#"+containerId).jstree(true);
|
||||
ref.deselect_all();
|
||||
ref.select_node(node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param containerId the id of jstree container
|
||||
|
||||
|
|
Loading…
Reference in New Issue