vartree = 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 マッピング, ActionForm フォーム,
HttpServletRequest リクエスト, HttpServletResponse レスポンス) {
String systemId = request.getParameter("node");
String haveCheckBox = request.getParameter("haveCheckBox");
IMenuManager menuManager = this.getPkgServer().getDriver().getSystemManageServer().getMenuManager();
リストノード = 新しい ArrayList();
StringparentNodeName =menuManager.getMenu(Long.parseLong(systemId)).getName() ;
リストメニュー = menuManager.getMenus("em.parent_name= '" 親ノード名 "'");
for(Menu menu:menus){
HashMap hm=new HashMap();
hm.put("id", menu.getId());
hm.put("テキスト", menu.getTitle());
hm.put("iconCls",menu.getName());
nodes.add(hm);
}
JSONArray ary = new JSONArray(nodes);
writeJson(response, ary.toString());
}