Grid Filter partial


Hi, simple question, this filter is searching for rows matching “Canada” into the column “country”{ by: “country”, match: “Canada” });

What if i wanna search the rows that just “contains” Canada instead of being exact match?


Hi Daniele_Cosenza, :vulcan_salute:

filter method accept a function to make the comparison: item =>"Canada") >=0 );

A more reusable and flexible approach is use the compare property

const contains = (value, match) => value.indexOf(match) >= 0

// Now we can use contains with any field{ by: "country", match: "Canada", compare: contains })

// or dynamic criteria{ by, match, compare: contains })

esa es la idea :grin:

Docs here


Thank you! I used this solution: item =>"Canada") != -1 );

And it works :grin: