Home >Java >javaTutorial >How to display data in tree shape?

How to display data in tree shape?

零下一度
零下一度Original
2017-06-25 10:24:041620browse
                                      String createTreeJson(List<Resource>         JSONArray rootArray =                        (resource.getParentid() ==                  JSONObject rootObj =                                       JSONObject createBranch(List<Resource>         JSONObject currentObj =         JSONArray childArray =                        (newNode.getParentid() !=  && newNode.getParentid().compareTo(currentNode.getId()) == 0                     JSONObject childObj =             (!             currentObj.put("children"               }


 //2、使用ztree实现树形数据简单无需用递归组装,简单方便
            dep.dep_code,          dep.dep_name,           dep2.dep_code AS parent_Code,                     on dep.pdep_id =   主要返回的对应ztree的id、pId、name,其它属性可自定义,ztree会自动识别组装树形节点的数据;
  还有就是实体bean中的属性除了定义数据库中的列属性之外,还应该把ztree中的节点属性也定义上

 

The above is the detailed content of How to display data in tree shape?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:4、Java中的数组笔记Next article:JAVA学习