组织机构有一个不动的根节点,想直接进入页面时显示根节点下的第一层树,应该怎么实现? (*^▽^*)
7 回复
当前的代码
treeTable = $("#treeTable").treetable({
expandable: true,
onNodeExpand: function () {
var node = this;
var rows = "<tr data-tt-id=\"loading\" data-tt-parent-id=\"" + node.id + "\" data-tt-branch=\"false\"><td colspan='5'><img src=\"" + base + "/assets/img/loading.gif\"/>loading</td></tr>";
treeTable.treetable("loadBranch", node, rows);
$.post("${base}/platform/orgz/department/child/" + node.id, {}, function (data) {
treeTable.treetable("unloadBranch", node);
treeTable.treetable("loadBranch", node, data);
});
}
});
@Wizzercn 自己顶下,顺便呼叫大佬
百度结果
treeTable = $("#treeTable").treetable({
indent: 20,
expandable: true,
isPadding:true,
clickableNodeNames:true,
onInitialized:function () {
$("#treeTable").css('display','inline-table');
$("#treeTable tr:first a").trigger('click');
},
onNodeExpand: function () {
var node = this;
var rows = "<tr data-tt-id=\"loading\" data-tt-parent-id=\"" + node.id + "\" data-tt-branch=\"false\"><td colspan='5'><img src=\"" + base + "/assets/img/loading.gif\"/>loading</td></tr>";
treeTable.treetable("loadBranch", node, rows);
$.post("${base}/platform/orgz/department/child/" + node.id, {}, function (data) {
treeTable.treetable("unloadBranch", node);
treeTable.treetable("loadBranch", node, data);
});
}
});
然而并不管用
添加回复
请先登陆