gabi
gabi

Reputation: 1376

How to aggregate store calls

I need to call one store two times with different parameter values. Is there any way to aggregate two different calls?

var result1 = myStore.load({params:{id:id1}}); ==> 3 results
var result2 = myStore.load({params:{id:id2}}); ==> 4 results
                                                   Total 7 results

Upvotes: 1

Views: 85

Answers (1)

Francis Ducharme
Francis Ducharme

Reputation: 4987

Use the addRecords: true config option to your second and subsequent load params if you want to aggregate the records.

See: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Store-method-load

But if you want to send both loading sequences as one request, you will have to modify your server's API to accept multiple IDs.

Upvotes: 2

Related Questions