AG-420 Improve React implementation

This commit is contained in:
Sean Landsman
2017-05-19 11:28:58 +01:00
parent 8677118a27
commit a438cb6169
9 changed files with 293 additions and 3049 deletions

View File

@@ -48,6 +48,7 @@ export default class extends Component {
// grid events
this.onGridReady = this.onGridReady.bind(this);
this.onRowClicked = this.onRowClicked.bind(this);
// component events
this.updateQuote = this.updateQuote.bind(this);
@@ -70,6 +71,10 @@ export default class extends Component {
this.gridApi.sizeColumnsToFit();
}
onRowClicked(params) {
this.props.onRowClicked(params.data.symbol);
}
componentWillMount() {
this.props.selectedExchange.supportedStocks.forEach(symbol => {
this.exchangeService.addSubscriber(this.updateQuote, symbol);
@@ -151,7 +156,8 @@ export default class extends Component {
enableSorting="true"
// events
onGridReady={this.onGridReady}>
onGridReady={this.onGridReady}
onRowClicked={this.onRowClicked}>
</AgGridReact>
</div>
);