Adding dynamic data to extjs repository

I need to add many records to the extjs data warehouse dynamically by looping. But store.add usually takes a lot of time. Can I add this data together?

+4
source share
2 answers

You can use store. loadData () or save. loadRecords () :

var mydata = [ [1, 'John', 'Smith'], [2, 'Fred', 'Jones'] ]; store.loadData(mydata, false); 
+6
source

When adding or changing a large amount of data in the ExtJS Store, I suggest disabling all events using the method:

 store.suspendEvents(); for(var i=0; i<9000, i++) { store.add({ ... }); } store.resumeEvents(); 

And when your insert ends, activate the events again. This can significantly improve performance.

+3
source

All Articles