Skip to content

[DataTable] How I can add custom icon in table caption? #1721

Answered by AlekseyManetov
Hoviadin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Hoviadin,

is there any way to add a custom icon to the header of a table column with a click event and so that it does not trigger the sorting click

The caption prop in columns configuration can accept ReactNode type, so you can try to provide a react component which will contain your icon + caption text. To not trigger sorting action, just add e.stopPropagation in you custom icon click.

and how I can catch a click on the sorting icon to do my own sorting?

Could you please describe more clearly what you need to do? Because usually sorting performed by the DataSources, for example for LazyDataSource current sorting value passed to the api callback and should be send to the server.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Hoviadin
Comment options

@AlekseyManetov
Comment options

@Hoviadin
Comment options

Answer selected by Hoviadin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants