Closed jubnl closed 7 months ago
See: https://github.com/bosskmk/pluto_grid/blob/master/demo/lib/screen/feature/column_filtering_screen.dart ClassYouImplemented
In this my example to every text fields use custom filter and CaseInsensitive I converted every text fields to UPPER Use COMMA to separate words: Ex: "A,B" "B,C" in any order: "A,B" = "B,A"
String toUpperCaseWithoutAccents(String input) { input = removeDiacritics(input).trim().toUpperCase(); return input; }
class ClassFilterContainAllWords implements PlutoFilterType { const ClassFilterContainAllWords(); @override get compare => ({ required String? base, required String? search, required PlutoColumn? column, }) { if (search != null) { search = toUpperCaseWithoutAccents(search); } var keys = search!.split(',').map((e) => e.trim().toUpperCase()).toList(); return keys.every((key) => base!.toUpperCase().contains(key)); }; @override String get title => 'Custom filter'; }
columnFilter: PlutoGridColumnFilterConfig(
filters: const [
...FilterHelper.defaultFilters,
ClassFilterContainAllWords(),
],
resolveDefaultColumnFilter: (column, resolver) {
if (column.type is PlutoColumnTypeText) {
return resolver
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Problem : All filters seem to be AND filters. I need to filter a column based on several possible values.
Examples:
At the moment I haven't found a way other than filtering the rows myself, then removing all rows and adding my filtered rows.