'Adding new columns in ag grid export excel

How to add new columns in ag-grid in the exported excel in reactjs. I think ag-grid dynamically export excel on right click. Where does this code exactly reside and how to edit it so that I can add an extra column only in exported excel.



Solution 1:[1]

You should be able to back-track from the ag-grid instance, the ag-grid instance is created as shown below,

new agGrid.Grid(divElement, gridOptions);

// divElement : document element for the grid
// gridOptions: param object having all grid related information

The gridOptions , will have column definitions in it, you can try disabling visibility of a column by setting column's display property i.e., hide to false, so that on export you have the column field. For more read refer here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1