EXT 异步加载树

//js var Tree = Ext.tree; var tree = new Tree.TreePanel({ //el:'tree', autoScroll:true,//自动滚动 animate:true,//动画效果 enableDD:false,//允许拖拽节点 border:false,//没有边框 rootVisible:true,//设为false,隐藏根节点 containerScroll: true, loader: new Tree.TreeLoader({ dataUrl:'treeAction.action' }) }); var root = new Tree.AsyncTreeNode({ text: '公司组织机构', draggable:false, id:'-1' }); tree.setRootNode(root); //java /** * ExtTree取根节点的子节点 * @return */ public String getSubNodes() throws Exception { log.debug("查询组织结构数节点: "+node); HttpServletResponse atc= ServletActionContext.getResponse(); atc.setCharacterEncoding("UTF-8"); PrintWriter out = atc.getWriter(); JSONArray josnArray = new JSONArray(); List lt = organizationTreeService.getSubNodes(Long.valueOf(node)); for (int i=0;i; } //无级树 就这么简单 !

你可能感兴趣的:(异步加载)