Skip to content

Instantly share code, notes, and snippets.

@maxkoretskyi
Created April 10, 2019 10:57
Show Gist options
  • Save maxkoretskyi/079212cc533f1207030c4f5d867dfaf9 to your computer and use it in GitHub Desktop.
Save maxkoretskyi/079212cc533f1207030c4f5d867dfaf9 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);
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