How to get the data of selected row in ag grid in angular2?

后端 未结 6 2025
温柔的废话
温柔的废话 2021-02-14 05:09

I have setup ag-grid in angular2 which works fine but i am not able to get the value of selected row...There are no errors in my console window...This is how i am initialising t

6条回答
  •  轮回少年
    2021-02-14 05:27

    On template, e.g.:

    (rowClicked)='onRowClicked($event)'
    (cellClicked)='onCellClicked($event)'
    (selectionChanged) = 'onSelectionChanged($event)'
    

    and then on component class:

    onRowClicked(event: any) { console.log('row', event); }
    onCellClicked(event: any) { console.log('cell', event); }
    onSelectionChanged(event: any) { console.log("selection", event); }
    

    Use Chrome console to check the event object contents.

提交回复
热议问题