Our blazing fast Grid component built with pure JavaScript
Hi, support,
I'm starting a new React project, I'm using the Grid component using the React wrapper component like this
<BryntumGrid {...gridConfig} />
.
The example in the Bryntum docs is like that:
const grid = new Grid({
features : {
pdfExport : {
exportServer : 'http://localhost:8080' // Required
}
}
})
// Opens popup allowing to customize export settings
grid.features.pdfExport.showExportDialog();
How Could I take the features of my Grid by Using the react wrapper?
Thanks in advance
Yes, Sure.
Here is how you could achieve it
- Inside your component which has the
BryntumGrid
, define a variable with setting useRef
to null
const grid = useRef(null);
- Then set the feature in
BryntumGrid
<BryntumGrid
pdfExportFeature = {{
exportServer : 'http://localhost:8080'
}}
/>
- And this is the onclick function of the export button
const onExport = useCallback(() => {
grid.current.instance.features.pdfExport.showExportDialog();
}, []);
That should be it to implement the pdfExport
feature in React Bryntum Grid