트리가 확장되지 않으면 트리의 노드를 가져올 수 없습니다. 은 이와 같이 사용하고 있습니다. tree.getNodeById (id);해당 노드 ID로 트리 노드 가져 오기
미리 감사드립니다.
해결 : 이것은 내가 사용한 코드입니다. 당신이 코드를 제공하지 않았기 때문에 여기에 무슨 일이 일어나고 있는지에 추측을 촬영
node_ids = [search_node_id,parent1_node_id,parent2_node_id]
function select_node(node_ids,length,evt,e){
var node=leftnav_treePanel.getNodeById(node_ids[length]); //length is length of node_ids list
var ajaxReq = ajaxRequest(node.attributes.url,0,"GET",true);
ajaxReq.request({
success: function(xhr) {
var response=Ext.util.JSON.decode(xhr.responseText);
if(length>0){
removeChild(node); // method to remove existing childnodes
appendChild(response.nodes,node); // method to add child nodes from response
node.expand();
select_node(node_ids,length-1,evt,e);
}else{
node.fireEvent(evt,node,e);
}
},
failure: function(xhr){
Ext.MessageBox.alert(_("Failure") , xhr.statusText);
}
});
}
코드를 입력하십시오. – Reimius