Filtering #79
Replies: 3 comments 1 reply
-
Hi @secretgspot, this seems like an important use case that I've overlooked. I'll work on extending the table filter plugin. |
Beta Was this translation helpful? Give feedback.
-
I'm thinking about how the implementation would work, and a rough idea comes to mind. We have a You could then have multiple matches based on this: ...
tableFilter: addTableFilter({
fn: ({ filterValue, value }) => {
const tokens = filterValue.split(' ');
return tokens.some((token) =>
value.toLowerCase().startsWith(token.toLowerCase()));
},
}),
... This would return all rows that had any matches in the filter value tokenized by spaces. However, I'm not sure if we should then sort the matches based on number of matching columns. An example of how this behaves: |
Beta Was this translation helpful? Give feedback.
-
For another datapoint, I generally expect filtering to find matches anywhere in the cell value, not just starting at the beginning of a word, like this: fn: ({ filterValue, value }) => {
return value.includes(filterValue);
}, Or case insensitive: fn: ({ filterValue, value }) => {
return value.toLowerCase().includes(filterValue.toLowerCase());
}, Incidentally these also solve the original issue in this thread. |
Beta Was this translation helpful? Give feedback.
-
How would one go about filtering within context?
| name | office |
| Sally Jones | Department of Staff |
is it possible to set up filter as such that typing Jones or Staff would pull up proper row?
with default settings ones must type Sally J in order to retrieve that row and just typing Jones or Staff will return none.
Beta Was this translation helpful? Give feedback.
All reactions