jquery ztree implements drop-down tree box using json data_jquery
WBOY
Release: 2016-05-16 16:48:15
Original
1200 people have browsed it
The company's recent project required the use of a tree-shaped drop-down box. I found a lot of source code on the Internet, and finally used zTree to implement it, because the code is more portable and data acquisition is easier. Without further ado, let’s get straight to the code.
public ModelAndView List(HttpServletRequest request, HttpServletResponse response,Product prod) throws Exception { Map map=new HashMap(); List< EquipTypeJson> list = testService.getAllEquipType();//Get source data from the database JSONArray jsonArray = JSONArray.fromObject(list); //Convert list data to json object String json = jsonArray.toString() ; //Convert json object to string map.put("jsonList", json); return new ModelAndView("equip/List").addAllObjects(map); }
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