AG-420 Improve React implementation
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user