Skip to content

Hide/show columns #80

Answered by nick-keller
danisal asked this question in Q&A
Nov 12, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @danisal and thx for the kind words.

Good news, this is already feasible!
Bad news, it requires a little bit of work on your side.

  • First, make sure to use the dynamic version of DSG to be able to add / remove columns on the fly.
  • Then you'll need to have a state to hold a Set (or Array) of hidden columns. You could use their ids or name.
  • Based on that Set of hidden columns, build the list of visible column objects to pass to DSG (use a useMemo for performance)

The way you allow the user to toggle columns is up to you, it could be a menu to the side, or you could use the context menu that is entirely customizable.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@danisal
Comment options

Answer selected by nick-keller
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