mercredi 19 septembre 2018

ExtJS - Grid multiple value filter in same column

Needed help in filtering grid with multiple values.

I am trying to create a menucheckitem with many phone value. And filter the grid based on the phone Checked.

By using below code, i am able to filter grid based on single value.

store.filter([{
    property: 'type',
    value: value
}]);

Now i wanted to filter grid, even if i select many phone checkBoxs. I tried using store.filterBy(). But, not working properly, i do not know what i am doing wrong.

var test = ["111-222-333","111-222-334","111-222-335"]

store.filterBy(function(record, val){
      return test.indexOf(record.get('phone')) != -1 
    }
});

This filters the first value only i.e. "111-222-333" value only.. Not filtering all other value in test.

find sample code in here - https://fiddle.sencha.com/#view/editor&fiddle/2ll7




Aucun commentaire:

Enregistrer un commentaire