treepanel 동적 불러오기 데이터 구현 코드

1756 단어
 
  
var tree = new Ext.tree.TreePanel({
region:'west',
title:' :',
width:200,
minSize:150,
maxSize:200,
iconCls:'ux-auth-menu-header-icon',
split:true,
autoScroll:true,
autoHeight:false,
collapsible:true,
rootVisable:false, //
root:new Ext.tree.TreeNode({
id:'root',
text:' ',
draggable:false,
expanded:true
}),
loader:new Ext.tree.TreeLoader({
dataUrl:'treeUtil.html?content.method=getAllMenuTreeNodes'
})
});
public void getAllMenuTreeNodes(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String systemId = request.getParameter("node");
String haveCheckBox = request.getParameter("haveCheckBox");
IMenuManager menuManager = this.getPkgServer().getDriver().getSystemManageServer().getMenuManager();
List nodes = new ArrayList();
String parentNodeName =menuManager.getMenu(Long.parseLong(systemId)).getName() ;
List menus = menuManager.getMenus("em.parent_name= '" +parentNodeName + "'");
for(Menu menu:menus){
HashMap hm=new HashMap();
hm.put("id", menu.getId());
hm.put("text", menu.getTitle());
hm.put("iconCls",menu.getName());
nodes.add(hm);
}
JSONArray ary = new JSONArray(nodes);
writeJson(response, ary.toString());
}

좋은 웹페이지 즐겨찾기