From ae69a261d6029d8094f1d91e30b1d87cd8343a93 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 30 Jan 2026 07:10:58 -0500 Subject: [PATCH] fix(client): use grid reference pattern for explicit refresh after data changes Fixes Clear Data bug in filter panels by using Radzen-recommended @ref + Reload() pattern instead of relying on implicit data binding to update the grid display. --- .../FilterPanels/AutocompleteFilterPanelBase.cs | 8 ++++++++ .../Components/FilterPanels/ComponentLotFilterPanel.razor | 2 +- .../Components/FilterPanels/FileUploadFilterPanelBase.cs | 6 ++++++ .../Components/FilterPanels/ItemNumberFilterPanel.razor | 5 ++++- .../Components/FilterPanels/OperatorFilterPanel.razor | 2 +- .../FilterPanels/PartOperationFilterPanel.razor | 2 +- .../Components/FilterPanels/ProfitCenterFilterPanel.razor | 2 +- .../Components/FilterPanels/WorkCenterFilterPanel.razor | 2 +- .../Components/FilterPanels/WorkOrderFilterPanel.razor | 2 +- 9 files changed, 24 insertions(+), 7 deletions(-) diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/AutocompleteFilterPanelBase.cs b/NEW/src/JdeScoping.Client/Components/FilterPanels/AutocompleteFilterPanelBase.cs index 6c8ed01..efeadd8 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/AutocompleteFilterPanelBase.cs +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/AutocompleteFilterPanelBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Radzen; +using Radzen.Blazor; namespace JdeScoping.Client.Components.FilterPanels; @@ -48,6 +49,11 @@ public abstract class AutocompleteFilterPanelBase : ComponentBase where T /// protected TItem? SelectedItem { get; set; } + /// + /// Reference to the data grid for explicit refresh. + /// + protected RadzenDataGrid? Grid { get; set; } + /// /// Gets the title displayed in the panel header. /// @@ -156,6 +162,7 @@ public abstract class AutocompleteFilterPanelBase : ComponentBase where T { Items.Remove(item); await ItemsChanged.InvokeAsync(Items); + if (Grid != null) await Grid.Reload(); } /// @@ -168,6 +175,7 @@ public abstract class AutocompleteFilterPanelBase : ComponentBase where T { Items.Clear(); await ItemsChanged.InvokeAsync(Items); + if (Grid != null) await Grid.Reload(); } } } diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/ComponentLotFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/ComponentLotFilterPanel.razor index 19622e7..027284d 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/ComponentLotFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/ComponentLotFilterPanel.razor @@ -19,7 +19,7 @@ } - + diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/FileUploadFilterPanelBase.cs b/NEW/src/JdeScoping.Client/Components/FilterPanels/FileUploadFilterPanelBase.cs index 3c9a174..35478ec 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/FileUploadFilterPanelBase.cs +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/FileUploadFilterPanelBase.cs @@ -46,6 +46,11 @@ public abstract class FileUploadFilterPanelBase : ComponentBase where TIt /// protected bool IsUploading { get; set; } + /// + /// Reference to the data grid for explicit refresh. + /// + protected RadzenDataGrid? Grid { get; set; } + /// /// Gets the title displayed in the panel header. /// @@ -138,6 +143,7 @@ public abstract class FileUploadFilterPanelBase : ComponentBase where TIt { Items.Clear(); await ItemsChanged.InvokeAsync(Items); + if (Grid != null) await Grid.Reload(); } } } diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/ItemNumberFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/ItemNumberFilterPanel.razor index 27c0941..89336ca 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/ItemNumberFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/ItemNumberFilterPanel.razor @@ -39,7 +39,7 @@ } - + @@ -76,6 +76,7 @@ private List _searchResults = []; private ItemViewModel? _selectedItem; private bool _isUploading; + private RadzenDataGrid? _grid; private async Task OnSearchAsync(LoadDataArgs args) { @@ -124,6 +125,7 @@ { Items.Remove(item); await ItemsChanged.InvokeAsync(Items); + if (_grid != null) await _grid.Reload(); } private async Task DownloadTemplateAsync() @@ -207,6 +209,7 @@ { Items.Clear(); await ItemsChanged.InvokeAsync(Items); + if (_grid != null) await _grid.Reload(); } } } diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/OperatorFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/OperatorFilterPanel.razor index 469389f..b92c2ef 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/OperatorFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/OperatorFilterPanel.razor @@ -30,7 +30,7 @@ } - + diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/PartOperationFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/PartOperationFilterPanel.razor index 5462560..5866051 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/PartOperationFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/PartOperationFilterPanel.razor @@ -18,7 +18,7 @@ } - + diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/ProfitCenterFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/ProfitCenterFilterPanel.razor index 73bf508..d8eb912 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/ProfitCenterFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/ProfitCenterFilterPanel.razor @@ -29,7 +29,7 @@ } - + diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkCenterFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkCenterFilterPanel.razor index d6255c0..df6b565 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkCenterFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkCenterFilterPanel.razor @@ -29,7 +29,7 @@ } - + diff --git a/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkOrderFilterPanel.razor b/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkOrderFilterPanel.razor index ebbefca..f33df99 100644 --- a/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkOrderFilterPanel.razor +++ b/NEW/src/JdeScoping.Client/Components/FilterPanels/WorkOrderFilterPanel.razor @@ -18,7 +18,7 @@ } - +