ant-design: Table component doesn't allow custom sort icons
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
Our team is using Ant tables, but we would like to change the sort icon to be an arrow instead of a triangle. We were wondering if we could send the sort icon via a prop type, but we could not find any prop type that satisfies this.
What does the proposed API look like?
<Table sortUpIcon={<MyIconAscend />} sortDownIcon={<MyIconDescend />} sortNoneIcon={<MyIconNoSort />} />
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 21 (5 by maintainers)
There is a solution with current APIs.
Hide default sort icon
Render Custom Sort Icon by
title
prop, which support({ sortColumns, filters }) => ReactNode
in antd version 3.10.0 or later.@afc163 Maybe provide a render prop
sorterIcon: ReactNode | (sortByAscend: boolean) => ReactNode
?have same issue any possible ways?
Any updates?
I looked into this feature recently and noticed the current implementation has a sortDown and a sortUp icon. I was wondering if we should keep the same or change it to support a sortNone prop as the OP suggested.
@afc163, I’d appreciate your input into the desired API. For those interested, this commit has some changes to support
sortDownIcon
andsortUpIcon
props keeping the default as it is today.Any updates?
To follow the implementation of the current sortIcon, we should design API like below.
However it seems to be a little complicated therefore I would like to implement API like below and refactor the logic in useSorter.tsx
To refactor like this, I must know the parts which would be affected.
Would you let me know if you have any ideas.
any updates??
any updates?
Any updates?
Any updates?
.ant-table-column-sorter { visibility: collapse; }