Skip to content

Commit

Permalink
fixes #735 [HxGrid] Corrupted in-progress rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Jan 15, 2024
1 parent dffe1a1 commit 88921f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Havit.Blazor.Components.Web.Bootstrap/Grids/HxGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
@{
List<IHxGridColumn<TItem>> columnsToRender = GetColumnsToRender();

bool shouldRenderLoadingData = totalCount == null;
bool shouldRenderLoadingData = (totalCount == null);
bool shouldRenderLoadingDataWithLoadingTemplate = shouldRenderLoadingData && (LoadingDataTemplate != null);
bool shouldRenderLoadingDataWithPlaceholders = shouldRenderLoadingData && !shouldRenderLoadingDataWithLoadingTemplate && (PlaceholdersRowCountEffective > 0);
bool shouldRenderLoadingDataWithPlaceholders = shouldRenderLoadingData && (LoadingDataTemplate is null) && (PlaceholdersRowCountEffective > 0);

bool shouldRenderEmptyData = totalCount == 0;
bool shouldRenderEmptyData = (totalCount == 0);
bool shouldRenderData;
bool shouldRenderFooter = (totalCount > 0) || ((totalCount == 0) && this.ShowFooterWhenEmptyDataEffective);
var rowHeightValue = ItemRowHeightEffective;
Expand Down Expand Up @@ -55,7 +55,12 @@

@if (columnsToRender.Any() && (shouldRenderLoadingData || shouldRenderEmptyData || shouldRenderData))
{
<HxProgressIndicator InProgress="@(InProgress ?? (dataProviderInProgress /* indicates data loading */ && !shouldRenderLoadingDataWithPlaceholders /* but not when placeholders are used - in such case we are indicating data loading using the placeholders */))">
bool progressIndicatorInProgress =
(InProgress ?? dataProviderInProgress)
&& (ContentNavigationModeEffective != GridContentNavigationMode.InfiniteScroll)
&& !shouldRenderLoadingDataWithPlaceholders;

<HxProgressIndicator InProgress="progressIndicatorInProgress">

<div class="@CssClassHelper.Combine("hx-grid-container",ResponsiveEffective ? "table-responsive" : null, TableContainerCssClassEffective)">
<table class="@GetTableElementCssClass(totalCount > 0)">
Expand Down

0 comments on commit 88921f9

Please sign in to comment.