I have the following:
const gridRef = useRef<AgGridReact>(null);
const onBtnExport = useCallback(() => {
gridRef.current!.api.exportDataAsCsv({
columnSeparator: ',',
allColumns: true,
});
}, []);
which allows me to download grid data depending on which tab is selected:
{isPacingPerformanceWidgetActive && activeTab === 'pacing_performance' && (
<DashboardPacingPerformance ref={gridRef} />
)}
{isPublisherInsightsWidgetActive && activeTab === 'publisher_insights' && (
<DashboardPublisherInsights ref={gridRef} />
)}
the problem I have is that I can only download one grid at the time as gridRef will only be populated with whatever ui’s data is available.
I do have access to both tables data and I would like to download them at the same time , like a global export even if one of the tables is hidden.