support for toggling custom context menu (#1683)

* support for toggling custom context menu

* fix unit tests
This commit is contained in:
Denys Vuika
2017-03-03 09:25:08 +00:00
committed by Mario Romano
parent 4ca18bc8f9
commit 2e44550d7f
8 changed files with 30 additions and 14 deletions

View File

@@ -67,7 +67,8 @@
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
(click)="onRowClick(row, $event)"
(dblclick)="onRowDblClick(row, $event)"
[context-menu]="getContextMenuActions(row, col)">
[context-menu]="getContextMenuActions(row, col)"
[context-menu-enabled]="contextMenu">
<div *ngIf="!col.template">
<div *ngSwitchCase="'image'" class="cell-value">
<i *ngIf="isIconValue(row, col)" class="material-icons icon-cell">{{asIconValue(row, col)}}</i>

View File

@@ -45,6 +45,9 @@ export class DataTableComponent implements OnInit {
@Input()
fallbackThumbnail: string;
@Input()
contextMenu: boolean = false;
@Output()
rowClick: EventEmitter<DataRowEvent> = new EventEmitter<DataRowEvent>();