为什么这个Tree只显示一级节点
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
//某一节点下的所有子节点
function getChildren(id/*节点ID*/){
var $tree = $('#tree');
var node = $tree.tree('find',id);
var childrenNodes = $tree.tree('getChildren',node.target);
return childrenNodes;
}
//某节点的一级节点
function getSubChildren(id){
var $tree = $('#tree');
var node = $tree.tree('find',id);
var subNodes = [];
$(node.target)
.next().children().children("div.tree-node").each(function(){
subNodes.push($tree.tree('getNode',this));
});
return subNodes;
}
function getChildren(id/*节点ID*/){
var $tree = $('#tree');
var node = $tree.tree('find',id);
var childrenNodes = $tree.tree('getChildren',node.target);
return childrenNodes;
}
//某节点的一级节点
function getSubChildren(id){
var $tree = $('#tree');
var node = $tree.tree('find',id);
var subNodes = [];
$(node.target)
.next().children().children("div.tree-node").each(function(){
subNodes.push($tree.tree('getNode',this));
});
return subNodes;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询