From 3c624dcf3fc5e0c180b0a02e0aa2737c2c333391 Mon Sep 17 00:00:00 2001 From: Catalin Date: Mon, 13 Nov 2023 12:55:40 +0200 Subject: [PATCH] fix(grid): condition row highlighting --- .../angular/components/ui-grid/src/ui-grid.component.html | 2 +- .../angular/components/ui-grid/src/ui-grid.component.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/angular/components/ui-grid/src/ui-grid.component.html b/projects/angular/components/ui-grid/src/ui-grid.component.html index 888d76e7c..e6a547211 100644 --- a/projects/angular/components/ui-grid/src/ui-grid.component.html +++ b/projects/angular/components/ui-grid/src/ui-grid.component.html @@ -402,7 +402,7 @@ *ngIf="!isRowExpanded(row?.id) || expandMode === 'preserve'" [class.ui-grid-row-state-expanded]="isRowExpanded(row?.id)" [class.ui-grid-border-none]="!footer && last" - [class.highlighted-row]="highlightedEntityId != null && row.id != null && highlightedEntityId.toString() === row.id.toString()" + [class.highlighted-row]="allowHighlight && (row.id + '') === (highlightedEntityId + '')" [ngClass]="rowConfig?.ngClassFn(row) ?? ''" [tabIndex]="0" [attr.data-row-index]="index" diff --git a/projects/angular/components/ui-grid/src/ui-grid.component.ts b/projects/angular/components/ui-grid/src/ui-grid.component.ts index b688ece7f..5eaedd17e 100644 --- a/projects/angular/components/ui-grid/src/ui-grid.component.ts +++ b/projects/angular/components/ui-grid/src/ui-grid.component.ts @@ -412,6 +412,13 @@ export class UiGridComponent @Input() useCardView = false; + /** + * If the grid allows highlighting of a row + * + */ + @Input() + allowHighlight = false; + /** * Id of the entity that should be highlighted *