Skip to content

Instantly share code, notes, and snippets.

@maxkoretskyi
Created April 10, 2019 10:56
Show Gist options
  • Save maxkoretskyi/1b0399396eff2816912a7639b58f3510 to your computer and use it in GitHub Desktop.
Save maxkoretskyi/1b0399396eff2816912a7639b58f3510 to your computer and use it in GitHub Desktop.
export class AgGridReact extends React.Component {
gridOptions: AgGrid.GridOptions;
componentDidMount() {
...
let gridOptions = this.props.gridOptions || {};
if (AgGridColumn.hasChildColumns(this.props)) {
gridOptions.columnDefs = AgGridColumn.mapChildColumnDefs(this.props);
}
this.gridOptions = AgGrid.ComponentUtil.copyAttributesToGridOptions(gridOptions, this.props);
// don't need the return value
new AgGrid.Grid(this.eGridDiv, this.gridOptions, gridParams);
this.api = this.gridOptions.api;
this.columnApi = this.gridOptions.columnApi;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment