Skip to content

Instantly share code, notes, and snippets.

@maxkoretskyi
Created April 10, 2019 11:13
Show Gist options
  • Save maxkoretskyi/ec58e7f93f96c5bc6722e25506d482a5 to your computer and use it in GitHub Desktop.
Save maxkoretskyi/ec58e7f93f96c5bc6722e25506d482a5 to your computer and use it in GitHub Desktop.
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],
currentValue: nextProps[propKey]
};
}
});
AgGrid.ComponentUtil.getEventCallbacks().forEach((funcName: string) => {
if (this.props[funcName] !== nextProps[funcName]) {
changes[funcName] = {
previousValue: this.props[funcName],
currentValue: nextProps[funcName]
};
}
});
AgGrid.ComponentUtil.processOnChange(changes, this.gridOptions, this.api, this.columnApi);
}
}
@sskka100
Copy link

sskka100 commented Nov 6, 2019

I was looking for this code on several websites but finally found on this site.. Thank you it solved the code on my websites do my online class & take my class online for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment