How to filter a store with multiple values at once?

11,978

A bit cleaner:

var store = grid.getStore();
var selectedItems = csvList.split(","); //your list of comma separated values
store.clearFilter();
store.filterBy(function(record, id){
    return Ext.Array.indexOf(selectedItems, record.get("value")) !== -1;
}, this);
Share:
11,978

Related videos on Youtube

Anand Singh
Author by

Anand Singh

Updated on June 04, 2022

Comments

  • Anand Singh
    Anand Singh almost 2 years

    I have a Store attached to a grid with number of records. I have a combo box with mulitiSelect option. So whenever i select multiple values in the Combo box. the grid must be filtered with all the criteria provided. I can get the values from the combo box as comma separated values but unable to send them to store's filter config.

    Please Help!

    Thanks!

  • Mike
    Mike almost 11 years
    You are welcome :) If the answer is correct, could you accept it? Thanks!
  • rafalli
    rafalli over 7 years
    @Mike When store has more than 10000+ records, ExtJS get an error "[E] InternalError: too much recursion"