Skip to content

Instantly share code, notes, and snippets.

View maxkoretskyi's full-sized avatar

Max Koretskyi maxkoretskyi

View GitHub Profile
<AgGridReact
// useful for accessing the component directly via ref
ref="agGrid"
// these are simple attributes, not bound to any state or prop
rowSelection="multiple"
// these are bound props, so can use anything in React state or props
columnDefs={this.props.columnDefs}
export class AgGridReact extends React.Component {
componentWillReceiveProps(nextProps: any) {
const changes = <any>{};
const changedKeys = Object.keys(nextProps);
changedKeys.forEach((propKey) => {
...
if (!this.areEquivalent(this.props[propKey], nextProps[propKey])) {
changes[propKey] = {
previousValue: this.props[propKey],
export class AgGridReact extends React.Component {
componentDidMount() {
...
new AgGrid.Grid(this.eGridDiv, this.gridOptions, gridParams);
this.api = this.gridOptions.api;
this.columnApi = this.gridOptions.columnApi;
}
}
export class AgGridReact extends React.Component {
componentWillReceiveProps(nextProps: any) {
const changes = <any>{};
const changedKeys = Object.keys(nextProps);
changedKeys.forEach((propKey) => {
...
if (!this.areEquivalent(this.props[propKey], nextProps[propKey])) {
changes[propKey] = {
previousValue: this.props[propKey],
if (AgGridColumn.hasChildColumns(this.props)) {
gridOptions.columnDefs = AgGridColumn.mapChildColumnDefs(this.props);
}
if (AgGridColumn.hasChildColumns(this.props)) {
gridOptions.columnDefs = AgGridColumn.mapChildColumnDefs(this.props);
}
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);
}
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);
}
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);
}
@Bean('componentResolver')
export class ComponentResolver {
@Autowired("gridOptions")
private gridOptions: GridOptions;
@Autowired("componentProvider")
private componentProvider: ComponentProvider;
@Optional("frameworkComponentWrapper")
private frameworkComponentWrapper: FrameworkComponentWrapper;