diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index ff4a8f7530a..bbe6d9090ec 100755 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -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; @@ -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]; } diff --git a/src/app/showcase/components/table/tabledemo.html b/src/app/showcase/components/table/tabledemo.html index 7840d5a96bb..ccdccad0d3d 100755 --- a/src/app/showcase/components/table/tabledemo.html +++ b/src/app/showcase/components/table/tabledemo.html @@ -3267,7 +3267,8 @@

Events

onRowUnselect event.originalEvent: Browser event
event.data: Unselected data
- event.type: Type of unselection, valid values are "row" and "checkbox" + event.type: Type of unselection, valid values are "row" and "checkbox"
+ event.index: Index of the row Callback to invoke when a row is unselected.