@@ -166,7 +169,7 @@
-
+
@@ -207,16 +210,11 @@
var setting = {
check: {
enable: true,
- chkboxType: {"Y":"", "N":""}
+ chkboxType: {"Y":"ps", "N":"ps"}
},
view: {
dblClickExpand: false
},
- data: {
- simpleData: {
- enable: true
- }
- },
callback: {
beforeClick: beforeClick,
onCheck: onCheck
@@ -224,26 +222,51 @@
};
var zNodes =[
- {id:1, pId:0, name:"北京"},
- {id:2, pId:0, name:"天津"},
- {id:3, pId:0, name:"上海"},
- {id:6, pId:0, name:"重庆"},
- {id:4, pId:0, name:"河北省", open:true, nocheck:true},
- {id:41, pId:4, name:"石家庄"},
- {id:42, pId:4, name:"保定"},
- {id:43, pId:4, name:"邯郸"},
- {id:44, pId:4, name:"承德"},
- {id:5, pId:0, name:"广东省", open:true, nocheck:true},
- {id:51, pId:5, name:"广州"},
- {id:52, pId:5, name:"深圳"},
- {id:53, pId:5, name:"东莞"},
- {id:54, pId:5, name:"佛山"},
- {id:6, pId:0, name:"福建省", open:true, nocheck:true},
- {id:61, pId:6, name:"福州"},
- {id:62, pId:6, name:"厦门"},
- {id:63, pId:6, name:"泉州"},
- {id:64, pId:6, name:"三明"}
- ];
+ { name:"父节点1 - 展开", open:true,
+ children: [
+ { name:"父节点11 - 折叠",
+ children: [
+ { name:"叶子节点111"},
+ { name:"叶子节点112"},
+ { name:"叶子节点113"},
+ { name:"叶子节点114"}
+ ]},
+ { name:"父节点12 - 折叠",
+ children: [
+ { name:"叶子节点121"},
+ { name:"叶子节点122"},
+ { name:"叶子节点123"},
+ { name:"叶子节点124"}
+ ]},
+ { name:"父节点13 - 没有子节点", isParent:true}
+ ]},
+ { name:"父节点2 - 折叠",
+ children: [
+ { name:"父节点21 - 展开", open:true,
+ children: [
+ { name:"叶子节点211"},
+ { name:"叶子节点212"},
+ { name:"叶子节点213"},
+ { name:"叶子节点214"}
+ ]},
+ { name:"父节点22 - 折叠",
+ children: [
+ { name:"叶子节点221"},
+ { name:"叶子节点222"},
+ { name:"叶子节点223"},
+ { name:"叶子节点224"}
+ ]},
+ { name:"父节点23 - 折叠",
+ children: [
+ { name:"叶子节点231"},
+ { name:"叶子节点232"},
+ { name:"叶子节点233"},
+ { name:"叶子节点234"}
+ ]}
+ ]},
+ { name:"父节点3 - 没有子节点", isParent:true}
+
+ ];
function beforeClick(treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");