Reputation: 16
Could you tell me please where can I find property source (like in params for event onRowClicked) , if I call property onRowSelected. I need to change the color of the rows which I click by checkbox enter image description here
grid = {
columnDefs: [],
rowSelection: 'multiple',
rowData: null,
rowGroupPanelShow: 'always',
getRowStyle: function (params) {
//some code for changing background-color
},
onSelectionChanged: rowSelectionChanged,
onRowDoubleClicked: onRowDoubleClicked,
groupSelectsChildren: false,
onRowClicked: clickFunction,
suppressRowClickSelection: true,
onRowSelected: selectionChangedFunc,
onGridReady: function() {
this.api.hideOverlay();
}
};
function selectionChangedFunc(params){
console.log(params)
}
function clickFunction(params){
console.log(params)
}
Upvotes: 0
Views: 885
Reputation: 658077
Just use the index of the highlighted item
<div *ngFor="let row of rows;let i=idx"
(click)="selectedRow = i"
[class.highlighted]="i == selectedRow">{{row.data}}<div>
Upvotes: 2