zoukankan      html  css  js  c++  java
  • zTree增加树形菜单格式

    result为json字符串

            //展示树形菜单
            function showMenuTree(result) {
    
                console.log("页面展示函数:"+result);
    
                //属性菜单设置
                let setting = {
                                data: {
                                    //简单JSON格式,自动创建父子关系
                                    simpleData: {
                                            enable: true,
                                            idKey: "id", //id属性名
                                            pIdKey: "pid", //父id属性名
                                            rootPId: 0 //根节点id的值
                                    }
                                }
                };
    
                //添加一个根节点,默认为打开
                result.push({"id":0,"name":"控制菜单","open":true});
                //初始化树形菜单
                $.fn.zTree.init($("#ztree_menu"), setting, result);
            }
    
  • 相关阅读:
    hdoj:2033
    hdoj:2032
    hdoj:2031
    hdoj:2029
    hdoj:2028
    hdoj:2027
    hdoj:2024
    hdoj:2023
    hdoj:2022
    hdoj:题目分类
  • 原文地址:https://www.cnblogs.com/shmebluk/p/13839327.html
Copyright © 2011-2022 走看看