这个要修改xtree2.js文件
添加2个方法
//在1522行原先方法下添加
//zz
function WebFXTreeItem(sText, oAction,target) {
WebFXTreeAbstractNode.call(this, sText, oAction,target);
}
在288 行原先方法下添加
//zz
function WebFXTreeAbstractNode(sText, oAction,target) {
this.childNodes = [];
if (sText) this.text = sText;
if (oAction) this.action = oAction;
if (target) this.target = target;
this.id = webFXTreeHandler.getUniqueId();
if (webFXTreeConfig.usePersistence) {
this.open = webFXTreeHandler.persistenceManager.getExpanded(this);
}
webFXTreeHandler.addNode(this);
}
测试代码:
tree.add(new WebFXTreeItem("Tree Item 1","
http://www.google.com","_about"));