After transitioning my tables to Mui-datagrid on Material UI 5, I encountered a unique challenge with an array of objects. Specifically, I aim to implement a phone number filter in this column, but the numbers are stored within object lists.
phone: [
{ type: "home", number: "795-946-1806" },
{ type: "mobile", number: "850-781-8104" }
]
I was hoping for a method like 'customFilterAndSearch'
or a way to customize search functionality for this specific field.
customFilterAndSearch: (term, rowData) =>
!!rowData?.suppressedOptions.find(({ description }) =>
description?.toLowerCase().includes(term.toLowerCase())
),
While experimenting with the filterOperators
, I have not achieved success yet. I have provided a detailed example here https://codesandbox.io/s/mui-data-grid-vs05fr?file=/demo.js