是否可以递归地调用Store reload:
fetchData: function (sDate, priorDay) {
store = Ext.getStore('OutOfBalanceList');
store.reload({
params: {
startDate: searchForm.startDate,
endDate: searchForm.endDate,
cusip: searchForm.cusip,
account: searchForm.account
},
callback: function (records, options, success) {
if (records.length == 0) {
var pdate = priorDay;
priorDay.setDate(pdate.getDate() - 1);
sDate.setValue(priorDay);
searchForm.startDate = Ext.Date.format(sDate.value, 'm/d/Y');
fetchData(sDate, priorDay);
}
}
});由于Sync特性似乎缺失了,所以在Store构造中,也许我可以通过递归调用获得相同的东西。
如果是的话,有人能帮我正确地构造这个电话吗。我得到了一个错误:"Uncaught : fetchData是未定义的“。
发布于 2016-01-21 11:12:28
您在哪里声明函数fetchData?
根据在对象中声明函数fetchData的结构,似乎如下:
var plop = {
...
fetchData: function() {
...
}
}如果是这样,则需要在声明的函数var plop= { fetchData: function (.){
... plop.fetchData(...) } }在您的例子中,我建议创建一个单例类,或者类似于包含您的方法fetchData的类。
希望它有帮助,如果还没有解决你的问题。
https://stackoverflow.com/questions/34439114
复制相似问题