我需要在 init 上使用以下函数填充存储数据:
Ext.define('Vcs.store.Years', {
extend: 'Ext.data.Store',
fields: ['year'],
data: this.getYears(),
getYears: function() {
var data = []
date = new Date
thisYear = date.getFullYear();
for(var i = thisYear - 100; i <= thisYear; i++) {
data.push({
year: i,
});
}
return data;
}
});
此代码给出错误:Object [object global] has no method 'generateYears'