Hi,
Indeed I had to use the filterBy function.
Here's the working code. I hope this could help.
Code:
getCountries: function (combo, rec, index) {
var store = Ext.getStore('MetrSeriesStore');
// If nothing selected, I removed all previously selected filter so I display all datas of my store
if (rec == '') {
store.clearFilter();
} else {
// a string that will contain the instruction to evaluate
var result;
// I put the selected value of my combo into an Array
var countr = rec.toString();
var valueArray = countr.split(",");
store.filterBy(function (s) {
/*
* For each value I will concatenate the result value in order to filter on several options
*/
for (var i = 0; i < valueArray.length; i++) {
if (i > 0) {
result = result + "|| s.get('LABEISO') =='" + valueArray[i] + "'";
} else {
result = "(s.get('LABEISO') == '" + valueArray[i] + "'";
}
}
/* I finish the string to have a string that will be a valid instruction
* Example if I selected Belgium and Denmark in my combo list:
* (s.get('LABEISO') == 'Belgium' || s.get('LABEISO') == 'Denmark');
*/
result = result + ");"
// I evaluate my string to execute it as an instruction
return eval(result);
});
}
}