zTree第五章,zTree的nodes数据例子

Posted whoknows1

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zTree第五章,zTree的nodes数据例子相关的知识,希望对你有一定的参考价值。

var nodes1 = [
{
name: "小学",
iconOpen: folderOpen,
iconClose: folder,
chkDisabled :true,
children: [
{
name: "语文",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "一年级上册",
icon: file,
},
{
name: "一年级下册",
icon: file,
}
]
},
]
},
{
name: "数学",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "一年级上册",
icon: file,
},
{
name: "一年级下册",
icon: file,
}
]
},
]
},
{
name: "英语",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "一年级上册",
icon: file,
},
{
name: "一年级下册",
icon: file,
}
]
},
]
},
]
},
{
name: "初中",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "语文",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "九年级上册",
icon: file,
},
{
name: "九年级下册",
icon: file,
}
]
},
]
},
{
name: "数学",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "九年级上册",
icon: file,
},
{
name: "九年级下册",
icon: file,
}
]
},
]
},
{
name: "英语",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "九年级上册",
icon: file,
},
{
name: "九年级下册",
icon: file,
}
]
},
]
},
{
name: "科学",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "九年级上册",
icon: file,
},
{
name: "九年级下册",
icon: file,
}
]
},
]
}
]
},
{
name: "高中",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "语文",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "高年级上册",
icon: file,
},
{
name: "高年级下册",
icon: file,
}
]
},
]
},
{
name: "数学",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "高年级上册",
icon: file,
},
{
name: "高年级下册",
icon: file,
}
]
},
]
},
{
name: "英语",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "高年级上册",
icon: file,
},
{
name: "高年级下册",
icon: file,
}
]
},
]
},
{
name: "信息技术",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "人教版",
iconOpen: folderOpen,
iconClose: folder,
children: [
{
name: "高年级上册",
icon: file,
},
{
name: "高年级下册",
icon: file,
}
]
},
]
}
]
},
];

 

 

 

 


var nodes2 = [ {
name : "小学",
iconOpen : folderOpen,
iconClose : folder,
isParent :true,

/*open :true,*/
}, {
name : "初中",
iconOpen : folderOpen,
iconClose : folder,

}, {
name : "高中",
iconOpen : folderOpen,
iconClose : folder,

}, ];

























































































































































































































































































以上是关于zTree第五章,zTree的nodes数据例子的主要内容,如果未能解决你的问题,请参考以下文章

ztree回显选中节点

ztree设置节点checked

ztree添加节点问题

zTree根节点默认打开

zTree通过指定ID找到节点并选中

ztree在使用的时候,展开所有的子节点的时候,会撑大整个父盒子怎么解决