Default sorting icon
How do I set a default sorting icon? I've seen some ppl suggest using canSort in an operation but it doesn't seem to exist in v8?
I'm using the default sorting code w/ bootstrap icons
2 Replies
other-emerald•2y ago
Hey, wondering if you ever got anywhere with this?
I've also not been able to set the
asc
or desc
icons as it seems to only accept a string
🤔
I believe I've managed to set a default icon, you can set the null
in [header.column.getIsSorted() ?? null]
to be an icon - that should set it as the default.stormy-gold•2y ago
Have you seen
column.getCanSort()
?https://tanstack.com/table/v8/docs/api/features/sorting#getcansortSorting APIs | TanStack Table Docs
State
Sorting state is stored on the table using the following shape: