You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect a way to be possible to set the filters of the column header, based on the value of that column on the dataSource dynamically. Lets say we have the following dataSource that comes from a server after a request:
const dataSource = [
{
id: 1,
name: 'Erick'
},
{
id: 2,
name: 'Edward'
},
{
id: 3,
name: 'Elder'
}
]
const columns = [
{
dataSource: 'id',
title: 'ID'
},
{
dataSource: 'name',
title: 'Name',
filters: []
}]
/*
Filters should be an array with the values of the column in the dataSource, like bellow
const filters = [
{
text: 'Erick',
value: 'Erick'
},
{
text: 'Edward',
value: 'Edward'
},
{
text: 'Elder',
value: 'Elder'
}]
*/
What is actually happening?
You can only set the values of the "filters" previously because you need to pass the value of the filters to the "columns" of the table.
Environment
Info
antd
4.23.5
React
18
System
Windows 10
Browser
Brave
I spent a lot of my time trying to figure out a way to do this in a good method but I could'nt figure out anything to do this behaviour.
The text was updated successfully, but these errors were encountered:
Reproduction link
Steps to reproduce
Just open the sandbox
What is expected?
I expect a way to be possible to set the filters of the column header, based on the value of that column on the dataSource dynamically. Lets say we have the following dataSource that comes from a server after a request:
What is actually happening?
You can only set the values of the "filters" previously because you need to pass the value of the filters to the "columns" of the table.
I spent a lot of my time trying to figure out a way to do this in a good method but I could'nt figure out anything to do this behaviour.
The text was updated successfully, but these errors were encountered: