13 Jun 2013 8:49 AM #1
Unanswered: List refresh issues - refreshFn gone from PullRefresh plugin
By what sorcery does the PullRefresh list plugin refresh the data? When one of the items in the list goes away on the server, it is not removed from the list when I refresh it via pull-to-refresh. However, if I explicitly refresh the store, i.e. I call Ext.getStore('Servers').load(), the data is refreshed properly and the removed item disappears as expected.
I had been resolving this issue by specifying a refreshFn function on the PullRefresh plugin that gets the list's store and calls load(). When this stopped working, I was surprised to find that refreshFn was removed in the latest version of Touch.
How can I accomplish this now? Can I just override the fetchLatest function? It seemed to work when I gave it a quick test, but I don't know if I broke something else by doing that.
15 Jun 2013 4:46 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
The pullrefresh plugin only seems to handle updated or new records. It loads the data outside of the store then iterates through the records returned and tries to match it with the ones in the store. If a match is found, it will update the data, if one is not found then it will add the record to the store.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
15 Jun 2013 9:30 AM #3
Thanks for the explanation. Do you see any issues with overriding the fetchLatest function in PullRefresh to just call load() on the Store? As I said, it seems to work without issue, but I don't know if that broke something else.