我有带有 totalCount 值的 json 响应。我在加载函数中获得了 totalCount 值。我在加载存储 If(totalCount>0) 之前在控制器中创建存储。它正在执行 else 条件。谁能告诉我如何加载商店和检查条件?是否可以从没有加载功能的字段中获取记录?
var totalCount=0;
store.load(
{
scope: this,
callback: function(records, operation, success) {
totalCount = records[0].data.totalCount
}
}
);
if (totalCount > 0) {
console.log("record found");
} else {
console.log("record not found");
}