EXTJS 动态树 动态根节点

tchapex tchapex 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
root = new Ext.tree.AsyncTreeNode({
id : '0',
text : '导航菜单'
});

我现在想让id、text是动态的。

NavTree = function(){
var root;
var root_id;
var root_name;

return {

int : function() {
this.getRootID;
this.getRootName;

// alert();
root = new Ext.tree.AsyncTreeNode({
id : root_id,
text : root_name

});
},

// dwr获取InstrType
getRootID : function(){
InstrTypeChange.getInstrType(this.getRootIDRS);
},
getRootIDRS : function(data){
root_id = data;
return;
},


// dwr获取TypeName
getRootName : function(){
InstrTypeChange.getTypeName(this.getRootNameRS);
}
getRootIDRS : function(data){
root_id = data;
return;
}

}();


现在问题是,如果在root = new Ext.tree.AsyncTreeNode({... 之前加上alert();就可以得到root_id, root_name,注释掉alert()后就得不到了,请问是什么原因...
高手支招啊,困惑好几天了...

...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
tchapex
Ajax 52,778 成员 25,334 内容