-
8 Dec 2012 2:10 AM #1
Unanswered: Refresh list no working
Unanswered: 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 :
And i remove a data :Code:myDataListView.setStore("FavorisClubsStorage");
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 ?Code:FavorisClubsStorage.remove(record); myDataListView.refresh();
Thanks
-
10 Dec 2012 6:46 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
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);Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote