mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
raise keyboard events, improve task list keyboard handling (#2401)
This commit is contained in:
committed by
Eugenio Romano
parent
9f0e40a6e8
commit
e756db03cd
@@ -8,7 +8,8 @@
|
||||
[selectionMode]="selectionMode"
|
||||
(row-select)="onRowSelect($event)"
|
||||
(row-unselect)="onRowUnselect($event)"
|
||||
(rowClick)="onRowClick($event)">
|
||||
(rowClick)="onRowClick($event)"
|
||||
(row-keyup)="onRowKeyUp($event)">
|
||||
<loading-content-template>
|
||||
<ng-template>
|
||||
<!--Add your custom loading template here-->
|
||||
|
@@ -270,12 +270,7 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit {
|
||||
(this.data && this.data.getRows() && this.data.getRows().length === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit the event rowClick passing the current task id when the row is clicked
|
||||
* @param event
|
||||
*/
|
||||
onRowClick(event: DataRowEvent) {
|
||||
const item = event;
|
||||
onRowClick(item: DataRowEvent) {
|
||||
this.currentInstanceId = item.value.getValue('id');
|
||||
this.rowClick.emit(this.currentInstanceId);
|
||||
}
|
||||
@@ -290,6 +285,14 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit {
|
||||
this.rowsSelected.emit(this.selectedInstances);
|
||||
}
|
||||
|
||||
onRowKeyUp(event: CustomEvent) {
|
||||
if (event.detail.keyboardEvent.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
this.currentInstanceId = event.detail.row.getValue('id');
|
||||
this.rowClick.emit(this.currentInstanceId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Optimize name field
|
||||
* @param istances
|
||||
|
Reference in New Issue
Block a user