AG-420 Improve React implementation
This commit is contained in:
@@ -33,6 +33,7 @@ class TopMoversGrid extends Component {
|
||||
headerClass: 'align-right',
|
||||
cellRenderer: 'animateShowChange',
|
||||
cellClass: 'align-right',
|
||||
sort: 'desc',
|
||||
cellFormatter(params) {
|
||||
return params.value.toFixed(2)
|
||||
}
|
||||
@@ -53,38 +54,9 @@ class TopMoversGrid extends Component {
|
||||
this.gridApi = params.api;
|
||||
this.columnApi = params.columnApi;
|
||||
|
||||
// if (this.props.rowData) {
|
||||
// this.gridApi.setRowData(this.props.rowData);
|
||||
// }
|
||||
this.gridApi.sizeColumnsToFit();
|
||||
}
|
||||
|
||||
// componentWillReceiveProps(nextProps) {
|
||||
// let newRowData = nextProps.rowData;
|
||||
// let model = this.gridApi.getModel();
|
||||
//
|
||||
// // remove nodes not in new data set
|
||||
// let nodesToRemove = [];
|
||||
// for (let rowIndex = 0; rowIndex < model.getRowCount(); rowIndex++) {
|
||||
// let rowNode = model.getRow(rowIndex);
|
||||
// if (rowNode.data.symbol !== newRowData[rowIndex].symbol) {
|
||||
// nodesToRemove.push(rowNode);
|
||||
// }
|
||||
// }
|
||||
// this.gridApi.removeItems(nodesToRemove);
|
||||
//
|
||||
// // add new items in set
|
||||
// for (let rowIndex = 0; rowIndex < newRowData.length; rowIndex++) {
|
||||
// let model = this.gridApi.getModel();
|
||||
// let rowNode = model.getRow(rowIndex);
|
||||
//
|
||||
// if (!rowNode ||
|
||||
// rowNode.data.symbol !== newRowData[rowIndex].symbol) {
|
||||
// this.gridApi.insertItemsAtIndex(rowIndex, [newRowData[rowIndex]])
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div style={{height: 410, width: 400}}
|
||||
|
||||
Reference in New Issue
Block a user