Reputation:
I am trying to find a way in sencha touch store that when loading a new page of content using load or loadPage, the new data would be appended to the store rather than removing all existing data and updating them with the new ones.
Is there any config to tell the store to fetch and append data?
Thanks
Upvotes: 1
Views: 934
Reputation: 1585
I think you're looking for the clearOnPageLoad store config parameter. From the docs
True to empty the store when loading another page via loadPage, nextPage or previousPage. Setting to false keeps existing records, allowing large data sets to be loaded one page at a time but rendered all together.
It defaults to true so if you set it to false it should keep the old data. Looking at the code it looks like there's a parameter you can pass in to the loadPage options called addRecords. If it's set to true it will allow you to override clearOnPageLoad on a call by call basis, but I don't see it documented anywhere.
Upvotes: 2