SelectFilter formatter is not working properly
See original GitHub issueBy using multiselectFilter or selectFilter like below, the content of column ‘Category’ isn’t displayed and with selecting an option, no row is displayed.
Here is my code:
render() {
const selectOptions = {
0: 'A',
1: 'B',
2: 'C'
};
const columns = [
{
dataField: 'id',
text: 'ID'
},
{
dataField: 'category',
text: 'Category',
formatter: cell => selectOptions[cell],
filter: multiSelectFilter({
options: selectOptions,
})
}
];
return (
<BootstrapTable
keyField='id'
data={data}
columns={columns}
filter={filterFactory()}
/>
);
}
Here is my source of how to use multiSelectFilter.
If I modify selectOptions to
const selectOptions = {
"A": "A",
"B": "B",
"C": "C"
}
the filter works fine.
So I think the formatter is not working as expected and searches for the key instead of the value in the table.
This is what my json data looks like:
[{
"id": 1,
"category": "A"
}, {...}, {...}]
Do you have any idea how to fix this? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Missing formatter when using setColumns function in ...
setColumns() line, the local version works just fine and the formatter selectFilter works. The Tabulator version is 4.9. What would cause this?
Read more >How to Solve "Filter Not Working" or Enable Filter in Microsoft ...
But sometimes filter doesn't work properly. ... Suppose your date range has a formatting like this 8-OCT and you are searching like this ......
Read more >ffmpeg select filter only works properly after conversion to ...
ffmpeg select filter only works properly after conversion to same file format · Why is the original video not selecting or reading in...
Read more >How to use Excel filtering to resolve file format errors
Right-click (or Control-click on a Mac) on the cell containing the data in error. On Windows, select Filter > Filter by Selected Cell's...
Read more >Column Filter · react-bootstrap-table2 - GitHub Pages
Following is an example for custom select filter: import filterFactory, { selectFilter ... Note, the selectOptions can be an array or a function...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@NadineSch yes, you are right!
@AllenFang thanks for your fast reply. So you’re right with the formatter, my raw data is A, B or C and not 0, 1 or 2. Does that mean it’s necessary that the value i’m filtering for (A, B or C) is the key-attribute of the selectOptions-Object? Like:
[key]: what I’m looking for in my raw Data[value]: how to name it in my filter-menu (?)If I’m getting this right I’m clear now, thanks!