Is there a way to make the search work for cells which values are objects and a column formatter is used to represent a JSX code containing these values?
For example, we have:
const columns = [{
dataField: 'name',
text: 'Field name',
formatter: (cell) => (<div>
<div>{cell.title}</div>
<div>{cell.subtitle}</div>
<img src="{cell.icon}" >
</div>)
}]
const data = [{
name: {
title: 'Example text',
subtitle: 'Another example text',
icon: 'icon-example.png'
}, {
...
},
....
}]
And then we have:
< ToolkitProvider
columns={ columns }
data={ data }
search={ { searchFormatted: true } } >
{
props => <div>
<Search {...props.searchProps} />
<BootstrapTable {...props.baseProps} />
</div>
}
</ToolkitProvider
I really need this feature, but couldn't find any documentation about searching through cells with Object values.
Thank you
I found the solution to this in the documentation here . I tried using filterValue at first but using it in combination with search={{ searchFormatted: true }} caused the search not to work on this column.
Most helpful comment
I found the solution to this in the documentation here . I tried using
filterValueat first but using it in combination withsearch={{ searchFormatted: true }}caused the search not to work on this column.