topjui左侧菜单为什么只能显示二级菜单无法显示三级菜单
$.get(
url, {"levelId": "2"}, // 获取第一层目录
function (data) {
if (data == "0") {
window.location = "/Account";
}
console.log(data);
$.each(data, function (i, e) {// 循环创建手风琴的项
var pid = e.pid;
var isSelected = i == 0 ? true : false;
$('#RightAccordion').iAccordion('add', {
fit: false,
title: e.text,
content: "<ul id='tree" + e.id + "' ></ul>",
border: false,
selected: isSelected,
iconCls: e.iconCls
});
$.parser.parse();
$.get("./json/menu/menu_" + e.id + ".json", function (data) {// 循环创建树的项
console.log(data);
console.log(e.id);
$("#tree" + e.id).tree({
data: data,
lines: false,
animate: true,
onBeforeExpand: function (node, param) {
$("#tree" + e.id).tree('options').url = "./json/menu/menu_" + node.id + ".json";
},
onClick: function (node) {
if (node.url) {
addTab(node);
} else {
if (node.state == "closed") {
console.log(node);
$("#tree" + e.id).tree('expand', node.target);
} else if (node.state == 'open') {
$("#tree" + e.id).tree('collapse', node.target);
}
}
}
});
}, 'json');
});
}, "json"
);
}
这是调用的代码