From dbdce315711a2f9f948bd51614d9d59c67c0a997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikul=C3=A1=C5=A1=20Hobl=C3=ADk?= Date: Mon, 1 Jul 2024 15:00:46 +0200 Subject: [PATCH] [HxGrid] Placeholders do not use ItemCssClass - pass only index --- .../Grids/HxGrid.razor | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Havit.Blazor.Components.Web.Bootstrap/Grids/HxGrid.razor b/Havit.Blazor.Components.Web.Bootstrap/Grids/HxGrid.razor index 4122bfe7..1acf4a49 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Grids/HxGrid.razor +++ b/Havit.Blazor.Components.Web.Bootstrap/Grids/HxGrid.razor @@ -105,6 +105,24 @@ + @{ + RenderFragment placeholderRowTemplate = (int rowIndex) => + @ + + @foreach (IHxGridColumn column in columnsToRender) + { + // same as above this else section + GridCellTemplate cellTemplate = column.GetItemPlaceholderCellTemplate(new GridPlaceholderCellContext { Index = rowIndex }); + + @cellTemplate.Template + + } + ; + } + @if (shouldRenderData) { @@ -152,22 +170,6 @@ } ; - RenderFragment placeholderRowTemplate = (PlaceholderContext context) => - @ - - @foreach (IHxGridColumn column in columnsToRender) - { - // same as above this else section - GridCellTemplate cellTemplate = column.GetItemPlaceholderCellTemplate(new GridPlaceholderCellContext { Index = context.Index }); - - @cellTemplate.Template - - } - ; - @if (ContentNavigationModeEffective == GridContentNavigationMode.InfiniteScroll) { @@ -175,7 +177,7 @@ @rowTemplate(context) - @placeholderRowTemplate(placeholderContext) + @placeholderRowTemplate(placeholderContext.Index) } @@ -198,7 +200,7 @@ for (int i = 0; i < rowsToRender; i++) { GridPlaceholderCellContext placeholderContext = new GridPlaceholderCellContext { Index = pageOffset + i }; - @placeholderRowTemplate(placeholderContext) + @placeholderRowTemplate(placeholderContext.Index) } } else