<!--
tabindex=1 so the grid body can capture keyboard events.
-->
-<div class="eg-grid-body" tabindex="1" (keydown)="onGridKeyDown($event)">
- <div role="row" class="eg-grid-row eg-grid-body-row {{context.rowClassCallback(row)}}"
+
+ <tr 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">
+ *ngFor="let row of context.dataSource.getPageOfRows(context.pager); let idx = index"
+ tabindex="1" (keydown)="onGridKeyDown($event)">
<ng-container *ngIf="!context.disableSelect">
- <div class="eg-grid-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
+ <td class="eg-grid-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
<input type='checkbox' [(ngModel)]="context.rowSelector.indexes[context.getRowIndex(row)]"
i18n-aria-label="e.g. Row 13" attr.aria-label="Row {{context.pager.rowNumber(idx)}}"
#rowContextMenu="ngbPopover"
[ngbPopover]="contextMenu"
placement="right"
triggers="manual">
- </div>
+ </td>
</ng-container>
- <div class="eg-grid-cell eg-grid-number-cell eg-grid-cell-skinny-2">
+ <td class="eg-grid-cell eg-grid-number-cell eg-grid-cell-skinny-2">
{{context.pager.rowNumber(idx)}}
- </div>
- <div *ngIf="context.rowFlairIsEnabled" class="eg-grid-cell eg-grid-flair-cell">
+ </td>
+ <td *ngIf="context.rowFlairIsEnabled" class="eg-grid-cell eg-grid-flair-cell">
<!-- using *ngIf allows us to assign the flair callback to a value,
obviating the need for multiple calls of the same function -->
<ng-container *ngIf="context.rowFlairCallback(row); let flair">
</span>
</ng-container>
</ng-container>
- </div>
+ </td>
<!-- 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"
+ <td role="gridcell" class="eg-grid-cell eg-grid-body-cell"
[ngStyle]="{flex:col.flex}"
[ngClass]="{'eg-grid-cell-overflow': context.overflowCells}"
(dblclick)="onRowDblClick(row)"
<eg-grid-body-cell [context]="context" [row]="row" [column]="col">
</eg-grid-body-cell>
- </div>
- </div>
-</div>
-
+ </td>
+ </tr>
\ No newline at end of file
import {NgbPopover} from '@ng-bootstrap/ng-bootstrap';
@Component({
- selector: 'eg-grid-body',
+ selector: 'eg-grid-body, [eg-grid-body]',
templateUrl: './grid-body.component.html'
})
-<div *ngIf="isVisible" class="eg-grid-column-width-config">
- <div class="eg-grid-row">
- <div class="eg-grid-column-width-header" i18n>Expand</div>
- <div *ngFor="let col of columnSet.displayColumns()"
+ <tr class="eg-grid-row" *ngIf="isVisible">
+ <td class="eg-grid-column-width-header" i18n>Expand</td>
+ <td *ngFor="let col of columnSet.displayColumns()"
class="eg-grid-cell text-center" [ngStyle]="{flex:col.flex}">
<a (click)="expandColumn(col)" title="Expand Column" i18n-title>
<span class="material-icons eg-grid-column-width-icon">call_made</span>
</a>
- </div>
- </div>
- <div class="eg-grid-row">
- <div class="eg-grid-column-width-header" i18n>Shrink</div>
- <div *ngFor="let col of columnSet.displayColumns()"
+ </td>
+ </tr>
+ <tr class="eg-grid-row" *ngIf="isVisible"><td>
+ <td class="eg-grid-column-width-header" i18n>Shrink</td>
+ <td *ngFor="let col of columnSet.displayColumns()"
class="eg-grid-cell text-center" [ngStyle]="{flex:col.flex}">
<a (click)="shrinkColumn(col)" title="Shrink Column" i18n-title>
<span class="material-icons eg-grid-column-width-icon">call_received</span>
</a>
- </div>
- </div>
-</div>
+ </td>
+ </tr>
\ No newline at end of file
import {GridContext, GridColumn, GridColumnSet} from './grid';
@Component({
- selector: 'eg-grid-column-width',
+ selector: 'eg-grid-column-width, [eg-grid-column-width]',
templateUrl: './grid-column-width.component.html'
})
-
-<div row="row" class="eg-grid-row eg-grid-header-row">
+<tr row="row" class="eg-grid-row eg-grid-header-row">
<ng-container *ngIf="!context.disableSelect">
- <div role="columnheader"
+ <th role="columnheader"
class="eg-grid-cell eg-grid-header-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
<input type='checkbox' (click)="handleBatchSelect($event)"
i18n-aria-label aria-label="All rows"
[(ngModel)]="batchRowCheckbox">
- </div>
+ </th>
</ng-container>
- <div role="columnheader"
+ <th role="columnheader"
class="eg-grid-cell eg-grid-header-cell eg-grid-number-cell eg-grid-cell-skinny">
<span i18n="number|Row Number Header">#</span>
- </div>
- <div *ngIf="context.rowFlairIsEnabled"
+ </th>
+ <th *ngIf="context.rowFlairIsEnabled"
role="columnheader"
class="eg-grid-cell eg-grid-header-cell eg-grid-flair-cell">
<span class="material-icons">notifications</span>
- </div>
- <div role="columnheader"
+ </th>
+ <th role="columnheader"
*ngFor="let col of context.columnSet.displayColumns()"
draggable="true"
(dragstart)="dragColumn = col"
*ngIf="isColumnSorting(col, 'DESC')">arrow_downwards</span>
</a>
<span *ngIf="!col.isSortable">{{col.label}}</span>
- </div>
-</div>
-<div *ngIf="context.isFilterable"
+ </th>
+</tr>
+<tr *ngIf="context.isFilterable"
class="eg-grid-row eg-grid-filter-controls-row">
<ng-container *ngIf="!context.disableSelect">
- <div class="eg-grid-cell eg-grid-header-cell eg-grid-cell-skinny"></div>
+ <th class="eg-grid-cell eg-grid-header-cell eg-grid-cell-skinny"></th>
</ng-container>
- <div class="eg-grid-cell eg-grid-header-cell eg-grid-cell-skinny"></div>
- <div *ngIf="context.rowFlairIsEnabled"
- class="eg-grid-cell eg-grid-header-cell"></div>
+ <th class="eg-grid-cell eg-grid-header-cell eg-grid-cell-skinny"></th>
+ <th *ngIf="context.rowFlairIsEnabled"
+ class="eg-grid-cell eg-grid-header-cell"></th>
- <div *ngFor="let col of context.columnSet.displayColumns()"
+ <th *ngFor="let col of context.columnSet.displayColumns()"
class="eg-grid-cell eg-grid-filter-control-cell" [ngStyle]="{flex:col.flex}">
<eg-grid-filter-control [context]="context" [col]="col"></eg-grid-filter-control>
- </div>
-</div>
+ </th>
+</tr>
import {GridFilterControlComponent} from './grid-filter-control.component';
@Component({
- selector: 'eg-grid-header',
+ selector: 'eg-grid-header, [eg-grid-header]',
templateUrl: './grid-header.component.html'
})
overflow: hidden;
}
+.eg-grid-resizable th {
+ resize: horizontal;
+ overflow: auto;
+}
+
/* allow tooltips to be wider than the default 200px */
.eg-grid-cell .tooltip-inner {
max-width: 400px;
-
-<div class="eg-grid" role="grid">
-
- <eg-grid-toolbar #toolbar
+ <eg-grid-toolbar #toolbar
[gridContext]="context"
[gridPrinter]="gridPrinter"
[colWidthConfig]="colWidthConfig"
[disableSaveSettings]="!persistKey || ('disabled' === persistKey)">
</eg-grid-toolbar>
- <div #egGridStickyHeader [ngClass]="{'eg-grid-sticky-header' : context.stickyGridHeader}">
- <eg-grid-header [context]="context"></eg-grid-header>
- </div>
+<table class="eg-grid" role="grid">
+
+ <thead eg-grid-header [context]="context"
+ #egGridStickyHeader [ngClass]="{'eg-grid-sticky-header' : context.stickyGridHeader}">
+ </thead>
- <eg-grid-column-width #colWidthConfig [gridContext]="context">
- </eg-grid-column-width>
+ <tbody eg-grid-column-width #colWidthConfig [gridContext]="context" class="eg-grid-column-width-config">
+ </tbody>
<eg-grid-print #gridPrinter [gridContext]="context">
</eg-grid-print>
</div>
</ng-container>
- <eg-grid-body [context]="context"></eg-grid-body>
-</div>
+ <tbody eg-grid-body class="eg-grid-body" [context]="context"></tbody>
+</table>