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
If you are using onSelectionChanged()
you can get selected data from the onSelectionChanged
function by using api.getSelectedRows()
.
selectedRow: any;
canceLDateAGGrid() {
this.dateGridOptions = {
columnDefs: [{
headerName: this.Label[0].GEN_ORG_lblName,
field: 'DependantName',
width: 200,
filter: 'agTextColumnFilter'
}, ],
showRowSelection: true,
checkboxSelection: false,
onSelectionChanged: (event) = > this.onSelectionChanged(event),
};
}
onSelectionChanged(event) {
let selectdata = event.api.getSelectedNodes();
this.selectedRow = event.api.getSelectedRows();
console.log(this.selectedRow)
}