ExtJs 错误:没有方法“loadData”
我试图加载带有数据的树,但出现此错误,
Uncaught TypeError: Object [object Object] has no method 'loadData'
这是我的代码
function ReadTree() {
try {
objHandler.ReadAssets(function (serverResponse) {
if (serverResponse.error == null) {
var result = serverResponse.result;
if (result.length > 2) {
treestore.loadData(Ext.decode(result));
}
}
else {
alert(serverResponse.error.message);
}
}); //eo serverResponse
} //eo try
catch (e) {
alert(e.message);
}
}
Im trying to load a tree with data but i get this error
Uncaught TypeError: Object [object Object] has no method 'loadData'
this is my code
function ReadTree() {
try {
objHandler.ReadAssets(function (serverResponse) {
if (serverResponse.error == null) {
var result = serverResponse.result;
if (result.length > 2) {
treestore.loadData(Ext.decode(result));
}
}
else {
alert(serverResponse.error.message);
}
}); //eo serverResponse
} //eo try
catch (e) {
alert(e.message);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TreeStore 不是从
Ext.data.Store
继承的,因此没有loadData
方法。 TreeStore 和 Store 都继承自Ext.data.AbstractStore
,后者仅定义了load
方法。因此 TreeStore 有一个 load 方法,所以我认为你必须使用它。TreeStore does not inherit from
Ext.data.Store
and thus does not have aloadData
method. Both TreeStore and Store inherit fromExt.data.AbstractStore
which defines aload
method only. Therefore TreeStore has a load method, so I think you'll have to use that instead.