$("#tree").tree(
{
lines:true,
url:'auth?action=menu&parentId=-1',
onLoadSuccess:function()
{
$("#tree").tree('collapseAll');
},
onClick:function(node)
{
if(node.state=='closed'&&(!$("#tree").tree('isLeaf',node.target)))
{ //状态为关闭而且非叶子节点
$(this).tree('expand',node.target);//点击文字展开菜单
if (node.attributes && node.attributes.url)
{
openTab(node);
}
}
else
{
if($("#tree").tree('isLeaf',node.target)){ //状态为打开而且为叶子节点
if (node.attributes && node.attributes.url)
{
openTab(node);
}
}
else
{
$(this).tree('collapse',node.target);//点击文字关闭菜单
}
}
{
lines:true,
url:'auth?action=menu&parentId=-1',
onLoadSuccess:function()
{
$("#tree").tree('collapseAll');
},
onClick:function(node)
{
if(node.state=='closed'&&(!$("#tree").tree('isLeaf',node.target)))
{ //状态为关闭而且非叶子节点
$(this).tree('expand',node.target);//点击文字展开菜单
if (node.attributes && node.attributes.url)
{
openTab(node);
}
}
else
{
if($("#tree").tree('isLeaf',node.target)){ //状态为打开而且为叶子节点
if (node.attributes && node.attributes.url)
{
openTab(node);
}
}
else
{
$(this).tree('collapse',node.target);//点击文字关闭菜单
}
}