How can I get a ref to the table to export to a PDF? #2831
Unanswered
austingayler
asked this question in
Q&A
Replies: 0 comments
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.
-
I'm looking to add an export function like in the demo. The export function takes in the actual table component (https://github.com/adazzle/react-data-grid/blob/main/website/demos/exportUtils.tsx#L32), which works fine if the export button and table are located near each other in the hierarchy. In my app though, we wrap third party components, so it looks like:
So in this case I don't have access to the GridElement as shown in https://github.com/adazzle/react-data-grid/blob/main/website/demos/CommonFeatures.tsx#L345
And in the docs it doesn't seem like you can pass a
ref
to the grid component, so is there a recommended way of accessing it (in a React-y manner? I suppose otherwise I could usegetElementById
).Thanks!
Beta Was this translation helpful? Give feedback.
All reactions