Measure critical cell heights for badge alignment
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
<body>
|
||||
<Routes />
|
||||
<ReconnectModal />
|
||||
<script src="@Assets["tables.js"]"></script>
|
||||
<script src="@Assets["_framework/blazor.web.js"]"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user