在arrayVals中,我有加载时从商店获得的数据,现在我想从菜单项中的arrayVals填充该数据...如果我在加载方法之外调用me.items.push,它可以很好地处理虚拟数据但是当我在加载方法中调用它我收到错误,即 Object [object Object] 没有方法“push”
items = [];
var arrayVals = [];
me.getUserCompanyLogStore().load({
callback: function (records, operation, success) {
success: {
Ext.Array.each(records, function (record, index, array) {
arrayVals.push(record.get("company"));
});
Ext.Array.each(arrayVals, function (record, index, array) {
console.log(arrayVals)
me.items.push({ // Object [object Object] has no method 'push'
xtype: 'main-header-nav-FavoriteItem',
text: record
});
});
}
}
});