From 9fc12e2fcce25cd635ee33a23db0775b2458050d Mon Sep 17 00:00:00 2001 From: Loretta Date: Sat, 7 Feb 2026 08:55:00 +0100 Subject: [PATCH 1/2] Improve toolbar controls and async UX in stock taking - Added EnableNew and EnableEdit parameters to MgGridToolbarTemplate for finer control of toolbar button states. - Disabled "New", "Edit", and "Delete" actions in history and item grids by passing explicit parameters. - Introduced DxLoadingPanel in StockTakingTemplate for better async feedback. - Disabled "New" and "Close" buttons during async operations to prevent duplicates. - Enhanced combo boxes with search/filter and usability features. - Updated new/close stock taking logic to show loading, handle errors, and prevent duplicate actions. - Set focus to item combo box after saving a StockTakingItemPallet. - Removed global loading panel from StockTaking.razor; loading is now handled locally. - Performed minor code cleanups and removed obsolete code. --- .../Components/Grids/MgGridToolbarTemplate.razor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AyCode.Blazor.Components/Components/Grids/MgGridToolbarTemplate.razor b/AyCode.Blazor.Components/Components/Grids/MgGridToolbarTemplate.razor index 03f933d..75885d3 100644 --- a/AyCode.Blazor.Components/Components/Grids/MgGridToolbarTemplate.razor +++ b/AyCode.Blazor.Components/Components/Grids/MgGridToolbarTemplate.razor @@ -1,8 +1,8 @@ @using AyCode.Blazor.Components.Components.Grids - - + + @@ -40,7 +40,10 @@ [Parameter] public IMgGridBase Grid { get; set; } = null!; [Parameter] public RenderFragment? ToolbarItemsExtended { get; set; } [Parameter] public EventCallback OnReloadDataClick { get; set; } + [Parameter] public bool ShowOnlyIcon { get; set; } = false; + [Parameter] public bool EnableNew { get; set; } = true; + [Parameter] public bool EnableEdit { get; set; } = true; [Parameter] public bool EnableDelete { get; set; } = false; public MgGridToolbarBase GridToolbar { get; set; } = null!; From d5a908a46ff23b43bf37a04df2cb32ee3bbb34e7 Mon Sep 17 00:00:00 2001 From: Loretta Date: Mon, 23 Feb 2026 18:21:20 +0100 Subject: [PATCH 2/2] Update BuildUrlFromTemplate to use Regex with lambda Refactored BuildUrlFromTemplate to use Regex.Replace with a lambda for dynamic property replacement in template strings. Added a TODO comment about optimizing with cached delegates. --- AyCode.Blazor.Components/Components/Grids/MgGridDataColumn.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AyCode.Blazor.Components/Components/Grids/MgGridDataColumn.cs b/AyCode.Blazor.Components/Components/Grids/MgGridDataColumn.cs index a0083c2..93b0746 100644 --- a/AyCode.Blazor.Components/Components/Grids/MgGridDataColumn.cs +++ b/AyCode.Blazor.Components/Components/Grids/MgGridDataColumn.cs @@ -78,9 +78,12 @@ public class MgGridDataColumn : DxGridDataColumn internal static string BuildUrlFromTemplate(string template, object? dataItem) { if (dataItem == null) return template; + return Regex.Replace(template, "{([^}]+)}", match => { var propName = match.Groups[1].Value; + + //TODO: delegate-et kéne használni és cache-elni egy dictionary-ba! - J. var prop = dataItem.GetType().GetProperty(propName); if (prop != null) {