这是商店代码:
Ext.define('NG.store.WhatsNews', {
extend: 'NG.store.AbstractStore',
model: 'NG.model.auxClasses.notifications.WhatsNew',
alias: 'store.whatsnewstore',
autoLoad:true,
buffered: true,
pageSize: 50,
proxy: {
type: 'rest',
url: 'api/WhatsNew/'
}
});
这是模型:
Ext.define('NG.model.auxClasses.notifications.WhatsNew', {
extend: 'Ext.data.Model',
idProperty:'iD',
fields: [
{ name: 'iD', type: 'int' },
{ name: 'createDate', type: 'date', dateFormat: 'c' },
{ name: 'businessArchive', type: 'string' },
{ name: 'isPin', type: 'boolean' },
{ name: 'previousWhatsNewEvents' }
],
// self association model
associations: [{
type: 'hasMany',
model: 'auxClasses.notifications.WhatsNew',
name: 'previousWhatsNewEvents',
primaryKey: 'id',
associationKey: 'previousWhatsNewEvents'
}
});
这是来自控制器的代码:
init: function () {
var me = this;
me.control({
'whatsnewlist': {
whatsnewpinclick: function (rowIndex) {
var me = this,
store = me.getWhatsNewsStore(),
record = store.getAt(rowIndex);
record.set('isPin', !record.get('isPin'));
store.sync(); <<< THIS IS WHERE I FAILED
}
});
}...
这是来自框架的错误:(在 store getNewRecords 方法下失败)
似乎 Ext.data.PageMap 类不包含 filterBy 方法的定义。
这是一个已知问题吗?
有解决方法吗?