Can I have multiple 'Contains' filters on one column

Tags: #<Tag:0x00007fa994711fc0>

Given I have a column with the following data: [‘Alfie’, ‘Ollie’, ‘Rosie’, ‘Daisy’] and I apply a contains filter of contains ‘Alf’. It would filter to the first 1. But if I had another contains filter of ‘Oll’, I would expect to see the first 2 rows…

Is that correct, are contains filters able to have multiple “OR” values on one column?? I am setting it as a disjunction.

This is what I have

const columnIndex = this.table.propToCol(column.data);
const tableFilterPlugin = this.table.getPlugin('filters');

const currentFilters = get(
      tableFilterPlugin,
      `conditionCollection.conditions.disjunction[${columnIndex}][0].args`,
      [],
);

const newFilter = [...currentFilters, form.filterValue];
tableFilterPlugin.removeConditions(columnIndex);
tableFilterPlugin.addCondition(columnIndex, 'contains', newFilter, 'disjunction');
tableFilterPlugin.filter();

Hey @christine

here’s an example https://jsfiddle.net/15e34ro8/ of different filters, but you can use the same two times as well https://jsfiddle.net/15e34ro8/1/

1 Like