<span *ngIf="!column.cellTemplate"
[ngbTooltip]="column.disableTooltip ? null : context.getRowColumnValue(row, column)"
placement="top-left"
- class="{{context.cellClassCallback(row, column)}}"
+
triggers="mouseenter:mouseleave">
<ng-container *ngIf="column.datatype === 'bool'">
<eg-bool [value]="context.getRowColumnValue(row, column)"
</ng-container>
</span>
<span *ngIf="column.cellTemplate"
- class="{{context.cellClassCallback(row, column)}}"
+
[ngbTooltip]="column.disableTooltip ? null : column.cellTemplate"
placement="top-left"
#tooltip="ngbTooltip"
import {GridContext, GridColumn} from './grid';
@Component({
- selector: 'td.eg-grid-body-cell',
+ selector: 'eg-grid-body-cell',
templateUrl: './grid-body-cell.component.html'
})
<!-- 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 -->
- <td [context]="context" [row]="row" [column]="col" class="eg-grid-cell eg-grid-body-cell eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}}"
+ <td class="eg-grid-cell eg-grid-body-cell {{context.cellClassCallback(row, col)}}"
[ngClass]="{'eg-grid-cell-overflow': context.overflowCells}"
(dblclick)="onRowDblClick(row)"
(click)="onRowClick($event, row, idx)"
placement="bottom"
triggers="manual"
*ngFor="let col of context.columnSet.displayColumns()">
+ <eg-grid-body-cell [context]="context" [row]="row" [column]="col">
+ </eg-grid-body-cell>
</td>
</tr>
</colgroup>
<colgroup class="eg-grid-col-data">
<col *ngFor="let col of context.columnSet.displayColumns()"
- class="eg-grid-col eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}}"
+ class="eg-grid-col {{context.cellClassCallback(row, col)}}"
[ngStyle]="{flex:col.flex}">
</colgroup>
</tr>
(dragover)="onColumnDragEnter($event, col)"
(dragleave)="onColumnDragLeave($event, col)"
[ngClass]="{'dragover' : col.isDragTarget}"
- class="eg-grid-cell eg-grid-header-cell eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}}" [ngStyle]="{flex:col.flex}">
+ class="eg-grid-cell eg-grid-header-cell {{context.cellClassCallback(row, col)}}">
<span>{{col.headerLabel}}</span>
<button class="sortable label-with-material-icon" *ngIf="col.isSortable"
(click)="sortOneColumn(col)">
class="eg-grid-cell eg-grid-header-cell {{context.idlFieldDef}}"></th>
<th *ngFor="let col of context.columnSet.displayColumns()"
- class="eg-grid-cell eg-grid-filter-control-cell eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}}" [ngStyle]="{flex:col.flex}">
+ class="eg-grid-cell eg-grid-filter-control-cell {{context.cellClassCallback(row, col)}}">
<eg-grid-filter-control [context]="context" [col]="col"></eg-grid-filter-control>
</th>
</tr>
this.context.cellClassCallback =
this.cellClassCallback ||
function (row: any, col: GridColumn) {
+ const classNames = ['eg-grid-type-'+col.datatype, 'eg-grid-class-'+col.idlClass, 'eg-grid-col-'+col.name];
+ if (col.path)
+ classNames.push('eg-grid-path-'+col.path);
+
if (col.datatype === 'money') {
// get raw value
let val;
val = this.getObjectFieldValue(row, col.name);
}
if (Number(val) < 0) {
- return 'negative-money-amount';
+ classNames.push('negative-money-amount');
}
}
- return '';
+ return classNames.join(' ');
};
this.context.rowSelector.selectionChange.subscribe(