Measure critical cell heights for badge alignment

This commit is contained in:
2026-03-14 13:55:05 +01:00
parent d9219ece0b
commit 9f1b39d83a
4 changed files with 46 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
@using System
@using System.Collections.Generic
@using System.Diagnostics.CodeAnalysis
@inject IJSRuntime JSRuntime
@inject LookupService LookupService
<PageTitle>Critical Tables</PageTitle>
@@ -175,6 +176,8 @@
private bool isReferenceDataLoading = true;
private string? detailError;
private Dictionary<(string RollBand, string? GroupKey, string ColumnKey), CriticalTableCellDetail>? cellIndex;
private int tableLayoutVersion;
private int appliedLayoutVersion = -1;
private bool IsTableSelectionDisabled => isReferenceDataLoading || (referenceData?.CriticalTables.Count ?? 0) == 0;
protected override async Task OnInitializedAsync()
@@ -198,6 +201,7 @@
{
tableDetail = null;
cellIndex = null;
tableLayoutVersion++;
return;
}
@@ -222,9 +226,21 @@
{
isDetailLoading = false;
BuildCellIndex();
tableLayoutVersion++;
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (tableDetail is null || appliedLayoutVersion == tableLayoutVersion)
{
return;
}
await JSRuntime.InvokeVoidAsync("rolemasterTables.alignCriticalCells");
appliedLayoutVersion = tableLayoutVersion;
}
private void BuildCellIndex()
{
if (tableDetail?.Cells is null)