扩展方法
$.extend($.fn.tree.methods, {
getLevel:function(jq,target){
var l = $(target).parentsUntil("ul.tree","ul");
return l.length+1;
}
});
使用
var node = $(treeid).tree("getSelected");
var lv = $(treeid).tree("getLevel",node.target);
$.extend($.fn.tree.methods, {
getLevel:function(jq,target){
var l = $(target).parentsUntil("ul.tree","ul");
return l.length+1;
}
});
var node = $(treeid).tree("getSelected");
var lv = $(treeid).tree("getLevel",node.target);
评论 (0)