+<!-- uses dropdown menu CSS for easy stying, but it's not a dropdown -->
+<ng-template #contextMenu let-gridContext="gridContext">
+ <eg-grid-toolbar-actions-menu [gridContext]="gridContext">
+ </eg-grid-toolbar-actions-menu>
+</ng-template>
+
<!--
tabindex=1 so the grid body can capture keyboard events.
-->
<div class="eg-grid-body" tabindex="1" (keydown)="onGridKeyDown($event)">
- <div class="eg-grid-row eg-grid-body-row {{context.rowClassCallback(row)}}"
+ <div role="row" class="eg-grid-row eg-grid-body-row {{context.rowClassCallback(row)}}"
[ngClass]="{'selected': context.rowSelector.contains(context.getRowIndex(row))}"
*ngFor="let row of context.dataSource.getPageOfRows(context.pager); let idx = index">
- <div class="eg-grid-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
- <input type='checkbox' [(ngModel)]="context.rowSelector.indexes[context.getRowIndex(row)]">
- </div>
+ <ng-container *ngIf="!context.disableSelect">
+ <div class="eg-grid-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
+ <input type='checkbox' [(ngModel)]="context.rowSelector.indexes[context.getRowIndex(row)]"
+ #rowContextMenu="ngbPopover"
+ popoverTitle="Actions for Selected Rows" i18n-popoverTitle
+ (contextmenu)="onRowContextClick($event, row, rowContextMenu)"
+ [ngbPopover]="contextMenu"
+ placement="right"
+ triggers="manual">
+ </div>
+ </ng-container>
<div class="eg-grid-cell eg-grid-number-cell eg-grid-cell-skinny">
{{context.pager.rowNumber(idx)}}
</div>
</ng-container>
</ng-container>
</div>
- <div class="eg-grid-cell eg-grid-body-cell" [ngStyle]="{flex:col.flex}"
+ <!-- contextMenu applied to cells instead of rows so the position
+ of the popover is close to the mouse. As of writing, no way
+ to position the popover at the mouse -->
+ <div role="gridcell" class="eg-grid-cell eg-grid-body-cell"
+ [ngStyle]="{flex:col.flex}"
[ngClass]="{'eg-grid-cell-overflow': context.overflowCells}"
(dblclick)="onRowDblClick(row)"
(click)="onRowClick($event, row, idx)"
+ #rowContextMenu="ngbPopover"
+ popoverTitle="Actions for Selected Rows" i18n-popoverTitle
+ (contextmenu)="onRowContextClick($event, row, rowContextMenu)"
+ [ngbPopover]="contextMenu"
+ placement="bottom"
+ triggers="manual"
*ngFor="let col of context.columnSet.displayColumns()">
<eg-grid-body-cell [context]="context" [row]="row" [column]="col">