日期:2014-05-17 浏览次数:20547 次
<script type="text/javascript">
var zTree;
var demoIframe;
//setting 是 zTree 的全部设置参数集合,采用 JSON 结构,便于灵活配置
var setting = {
isSimpleData: true,
treeNodeKey: "id", //设置节点唯一标识属性名称
treeNodeParentKey: "pId", //设置节点的父节点唯一标识属性名称
nameCol: "name", //设置 zTree 显示节点名称的属性名称,此处默认为Name
showLine: true, //在树型中是否显示线条样式
root: { //zTree数据节点的根,全部节点数据都处于 root.nodes 内
isRoot: true,
nodes: []
},
async: true,
asyncUrl: "asyncdemo.aspx?&time="+Math.random(),
asyncParam: ["id","pId","name"], //异步调用时传到后台的参数
callback:{
asyncSuccess: zTreeOnAsyncSuccess
}
};
var treeNodes = [<%= NodesData%>];
$(document).ready(function() {
zTree = $("#treeid").zTree(setting, treeNodes);
});
function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
}
</script>