Skip to content

Commit

Permalink
Fixed #9823 - Add rowIndex to onRowUnselect
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Jan 26, 2021
1 parent 297beb0 commit 605831a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
this._selection = null;
this.selectionKeys = {};
this.selectionChange.emit(this.selection);
this.onRowUnselect.emit({ originalEvent: event.originalEvent, data: rowData, type: 'row' });
this.onRowUnselect.emit({ originalEvent: event.originalEvent, data: rowData, type: 'row', index: event.rowIndex });
}
else {
this._selection = rowData;
Expand All @@ -1008,7 +1008,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
let selectionIndex = this.findIndexInSelection(rowData);
this._selection = this.selection.filter((val, i) => i != selectionIndex);
this.selectionChange.emit(this.selection);
this.onRowUnselect.emit({ originalEvent: event.originalEvent, data: rowData, type: 'row' });
this.onRowUnselect.emit({ originalEvent: event.originalEvent, data: rowData, type: 'row', index: event.rowIndex });
if (dataKeyValue) {
delete this.selectionKeys[dataKeyValue];
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/showcase/components/table/tabledemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3267,7 +3267,8 @@ <h3>Events</h3>
<td>onRowUnselect</td>
<td>event.originalEvent: Browser event <br>
event.data: Unselected data <br >
event.type: Type of unselection, valid values are "row" and "checkbox"</td>
event.type: Type of unselection, valid values are "row" and "checkbox"<br>
event.index: Index of the row</td>
<td>Callback to invoke when a row is unselected.</td>
</tr>
<tr>
Expand Down

0 comments on commit 605831a

Please sign in to comment.