Extjs store find all

The Ext.data.Storefind method documentation says:

Gets the index of the first matching record in this store for a specific field value.

My question is how to find the indexes of all matching records in this store?

+5
source share
3 answers

I think the best function suits your needs queryBy(), because it returns an array of matching records.

You can still use each()to check if the model meets the criteria and then add them to the array. But this function is more suitable for moving all records in the repository, and not just for “filtering” data.

+8
source

Extjs , . , each && & .

+1

If you are using ExtJS 3.x, if you have a datastore referenced store

Ext.pluck(store.filter('field', 'value'), 'id');

returns an array containing indices of matching records.

+1
source

All Articles