jstree 默认展开第一级,没有接触过这个,怎么设置默认展开第一个节点,省级的 10
$(function(){$("#departmentTree").bind("before.jstree",function(e,data){//alert(data....
$(function() {
$("#departmentTree").bind("before.jstree", function(e, data) {
// alert(data.rslt.obj.attr("deptid"));
$("#alog").append(data.func + "<br />");
}).jstree({
"core" : {
/* core options go here */
},
"json_data" : {
"ajax" : {
"url" : function() {
var url = "/SAMS/departmentsAction.do?cmd=queryDepartmentTree";
return url;
},
"data" : function(n) {
return {
"operation" : "get_children",
"deptid" : n.attr ? n.attr("deptid").replace("node_",
"") : ""
};
}
}
},
"themes" : {
"theme" : "default",
"dots" : true,
"icons" : true,
"url" : "/SAMS/static/css/jstree/style.css"
},
"ui" : {
"initially_select" : ["node_4"]
},
"plugins" : ["themes", "json_data", "ui", "crrm"]
}); 展开
$("#departmentTree").bind("before.jstree", function(e, data) {
// alert(data.rslt.obj.attr("deptid"));
$("#alog").append(data.func + "<br />");
}).jstree({
"core" : {
/* core options go here */
},
"json_data" : {
"ajax" : {
"url" : function() {
var url = "/SAMS/departmentsAction.do?cmd=queryDepartmentTree";
return url;
},
"data" : function(n) {
return {
"operation" : "get_children",
"deptid" : n.attr ? n.attr("deptid").replace("node_",
"") : ""
};
}
}
},
"themes" : {
"theme" : "default",
"dots" : true,
"icons" : true,
"url" : "/SAMS/static/css/jstree/style.css"
},
"ui" : {
"initially_select" : ["node_4"]
},
"plugins" : ["themes", "json_data", "ui", "crrm"]
}); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询