var tree = new Ext.tree.TreePanel({
{
:'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 映射,ActionForm,
HttpServletRequest 請求,HttpServletResponse 回應) {
String systemId = request.getParameter("node");
String haveCheckBox = request.getParameter("have== .getDriver().getSystemManageServer().getMenuManager();
列表;節點= new ArrayList();
StringparentNodeName =menuManager.getMenu(Long.parseLong((pId)).getName(system(system)). ) ;
列表 menus = menuManager.getMenus("em.parent_name= '" ParentNodeName "'");
for(選單選單:選單){
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());
}