三、菜单对象类
public class XtbXtcd {
//菜单级别分类
public final static int NODE_UNKNOW = 0;
public final static int NODE_CATALOG = 1;
public final static int NODE_URL = 2;
public final static int NODE_FUNCTION = 4;
public final static int NODE_MENU = 8;
public final static int NODE_SYSTEM = 16;
private Integer xmdh; //菜单编号 主键
private String xmmc; //菜单名称
private String xmdz; //菜单地址
private Integer sjxm; //上级菜单编号
private String cdjb; //菜单级别
//user only this to instead type of string
public boolean isMenuItem() {
return (Integer.parseInt(cdjb) & NODE_MENU) == NODE_MENU;
}
public boolean isURL() {
return (Integer.parseInt(cdjb) & NODE_URL) == NODE_URL;
}
public boolean isCatalog() {
return (Integer.parseInt(cdjb) & NODE_CATALOG) == NODE_CATALOG;
}
public boolean isFunction() {
return (Integer.parseInt(cdjb) & NODE_FUNCTION) == NODE_FUNCTION;
}
public boolean isSystem() {
return (Integer.parseInt(cdjb) & NODE_SYSTEM) == NODE_SYSTEM;
}
public Integer getXmdh() {
return xmdh;
}
。。。。下略
}
四、其他实用功能粗解
1. checkbox使用
1.1 Jsp页面设置
tree.enableCheckBoxes(1);
tree.enableThreeStateCheckboxes(true);//级联选中下级节点
//check item
tree.setCheck(id,true);
//uncheck item
tree.setCheck(id,false);
//check branch
tree.setSubChecked(id,true);
//uncheck branch
tree.setSubChecked(id,false);
//check item
tree.setCheck(id,true);
//return ids of checked items
var list=tree.getAllChecked();//取得所有选中的,不包括父
var list=tree.getAllCheckedBranches() //取得所有选中的父。父的父。。。。
var list= tree.getAllPartiallyChecked() //取得所有选中的,包括父,父的父。。。
未完待续
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/106943/viewspace-927244/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/106943/viewspace-927244/