Replies: 1 comment 1 reply
-
|
fyi, there's a dedicated dynamic columns example https://www.material-react-table.com/docs/examples/dynamic-columns |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
The examples currently have column definitions within component, but in many real world applications, columns too get loaded via API.This is the current behaviour by default, initial state of empty array which gets replaced with columns on load
This could be made significantly better with some hacky initial state when you know a rough number of columns to be expected.
I have made a sandbox as a demo: https://stackblitz.com/edit/mrt-loading-ux?file=src%2FTS.tsx
Would be great to have some sort of official support to render a given number of columns, with a skeleton in column header cell while columns are loading.
Something like array of X nulls as initial state, and in that case show X columns with skeletons in header.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions