Extjs4.0.7 中 TreeStore.load()出现 url undefine 错误的解决方法
出错地点:
[java]
load: function(options) {
options = options || {};
options.params = options.params || {};
var me = this,
node = options.node || me.tree.getRootNode(),
root;
// If there is not a node it means the user hasnt defined a rootnode yet. In this case lets just
// create one for them.
if (!node) {
node = me.setRootNode({
expanded: true
});
}
if (me.clearOnLoad) {
node.removeAll(false); <span style="color:#FF0000;">//出错地点,不能返回值继续</span>
}
Ext.applyIf(options, {
node: node
});
options.params[me.nodeParam] = node ? node.getId() : 'root';
if (node) {
node.set('loading', true);
}
return me.callParent([options]);
}
});
解决方案:
[java]
handler: function (widget, event) {
/*I*****解决重载出现的错误,在load前清除数据,这是4.0.7的BUG******START************/
var delNode;
while (delNode = UserTreePanel.getRootNode().childNodes[0]) {
UserTreePanel.getRootNode().removeChild(delNode);
};
/*I*****解决重载出现的错误,在load前清除数据,这是4.0.7的BUG********END**********/
UserTreeStore.load({params:{userid:Ext.getCmp('User_Grant_Form').getForm().findField('UserID').value,MenuID:'B00'}
,callback:function(r,options,success){
if (success){
UserTreePanel.expandAll();
}
}
});
//UserTreeStore.load({params:{userid:Ext.getCmp('User_Grant_Form').getForm().findField('UserID').value,MenuID:'B00'}});
rt(checkid.toString());
; //myuserstore.load();
}
补充:web前端 , JavaScript ,