4
votes

I have a data view that renders a store of data.

Once in a while the user may opt in to add more items through different sources.

When that happens, i create a new store and loop through the result and add them to the primary data view store.

Is there a better way to merge two stores? or append loaded data to a store rather than refreshing it entirely?

1

1 Answers

4
votes

Check out the loadRecords method of Ext.data.Store

Loads an array of model instances into the store, fires the datachanged event. This should only usually be called internally when loading from the Proxy, when adding records manually use add instead

Parameters

records : Ext.data.Model[] The array of records to load

options : Object {addRecords: true} to add these records to the existing records, false to remove the Store's existing records first