ztree树形菜单

树形菜单的使用:


ztree树形菜单两种数据格式:

    1、标准json数据:

var nodes = [
	{name: "父节点1", children: [
		{name: "子节点1"},
		{name: "子节点2"}
	]}
];    

    2、简单json数据:

var nodes = [
	{id:1, pId:0, name: "父节点1"},
	{id:11, pId:1, name: "子节点1"},
	{id:12, pId:1, name: "子节点2"}
];

ztree树形菜单页面显示:

    设置菜单显示位置:

    开启简单json数据格式:
    var setting = {
    			data : {
    				simpleData : {
    					enable : true
    				}
    			}
    		}
    编写zTree树形菜单数据:
    var zNodes = [{id='本节点id',pId='父节点id',name='本节点名称'}]
    生成树形菜单:
    $.fn.zTree.init($("#ztree"),settinf,zNodes);



    你可能感兴趣的:(ztree,ztree)