-
Refresh list no working
Hi All,
I know, this question have been asked a thousand times, but i never found my solution.
There is it.
I have a simple Store
Code:
Ext.define('MyApp.store.Clubs', {
extend: 'Ext.data.Store',
alias: 'store.Clubs',
requires: [
'MyApp.model.Clubs'
],
config: {
groupDir: 'DESC',
model: 'MyApp.model.Clubs',
storeId: 'Clubs',
proxy: {
type: 'jsonp',
extraParams: {
},
url: 'http://www.myurl.com/mobile/clubs.php',
reader: {
type: 'json',
rootProperty: 'datas',
totalProperty: 'totalresults'
}
},
grouper: {
groupFn: function(record) {
return record.data.LMmember == 1 ? 'Clubs LESMILLS Members' : 'Clubs LESMILLS';
}
}
}
});
FavorisClubsStorage = Ext.create('MyApp.store.Clubs', {
alias : 'MyApp.store.FavorisClubsStorage',
storeId: 'FavorisClubsStorage'
});
FavorisClubsStorage.setAutoSync( true );
FavorisClubsStorage.getProxy().setNoCache( true );
FavorisClubsStorage.getProxy().setExtraParams(params);
I assign store to a dataview.List, like this :
Code:
myDataListView.setStore("FavorisClubsStorage");
And i remove a data :
Code:
FavorisClubsStorage.remove(record);
myDataListView.refresh();
And my problem, in myDataListView, record is still here. I try to remove it in different way since few hours, but no way. Someone have an idea ?
Thanks
-
This simple testcase is refreshing the list on it's own:
Code:
var store = new Ext.data.Store({
fields : ['foo'],
data : [
{ foo : 'One' },
{ foo : 'Two' },
{ foo : 'Three' },
{ foo : 'Four' },
{ foo : 'Five' }
]
});
var list = Ext.Viewport.add({
xtype : 'list',
itemTpl : '{foo}',
listeners : {
itemtap : function(list, idx, listItem, record) {
var store = list.getStore();
store.remove(record);
}
}
});
list.setStore(store);