直接上代码
/* --start zTree异步加载 */
var setting = {
data : {
simpleData : {
enable : true,
idKey : "id",
pIdKey : "pId",
rootPId : 0
}
},
async : {
enable : true,
contentType : "application/json",
url : '${url1}',
autoParam : [ "id", "name" ]
},
check : {
enable : true,
autoCheckTrigger : false,
chkboxType : {
"Y" : "ps",
"N" : "ps"
},
chkStyle : "checkbox",
nocheckInherit : true,
chkDisabledInherit : true
},
};
var zNodes = [ <s:property value="sb" escapeHtml="false"/> ];
var zNodes1 = [ <s:property value="sb" escapeHtml="false"/> ];
$(document).ready(function() {
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
$.fn.zTree.init($("#treeDem1"), setting, zNodes1);
});
/* --end zTree异步加载 */
/* --start zTree异步加载 */
var setting = {
data : {
simpleData : {
enable : true,
idKey : "id",
pIdKey : "pId",
rootPId : 0
}
},
async : {
enable : true,
contentType : "application/json",
url : '${url1}',
autoParam : [ "id", "name" ]
},
check : {
enable : true,
autoCheckTrigger : false,
chkboxType : {
"Y" : "ps",
"N" : "ps"
},
chkStyle : "checkbox",
nocheckInherit : true,
chkDisabledInherit : true
},
};
var zNodes = [ <s:property value="sb" escapeHtml="false"/> ];
var zNodes1 = [ <s:property value="sb" escapeHtml="false"/> ];
$(document).ready(function() {
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
$.fn.zTree.init($("#treeDem1"), setting, zNodes1);
});
/* --end zTree异步加载 */