0
我想要的功能添加到存儲類清洗店(代理+數據+同步),我可以通過myStoreVariable.cleanAll();
或Ext.getStore('storeId').cleanAll();
煎茶觸摸添加功能煎茶組件
稱它爲我的第一次嘗試是這樣的,但我無法從商店調用這個函數:
Ext.data.Store.cleanAll = function() {
this.getProxy().clear();
this.data.clear();
this.sync();
};
我的第二次嘗試是這樣的:
this.storeStore = Ext.create('Ext.data.Store', { id: 'myStore', model: 'myModel' });
this.storeStore.cleanAll = function() { /* my cleaning code(see above) */ };
這是工作,但我不想定義cleanAll爲我所有的商店。
您是否知道將此功能添加到商店類的可能性?所以,我可以從我通過Ext.create('Ext.data.Store',
你定義你自己的商店類?或者你只是實例化Ext.data.Store? – sha
我只是創造它們。 'Ext.create('Ext.data.Store',{id:'myId',model:'myModel'});'。但我想要所有商店的功能。 – Niklas
@sha我更新了帖子。 – Niklas