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.
This commit is contained in:
Loretta 2026-02-07 08:55:00 +01:00
parent e4e279e54c
commit 9fc12e2fcc
1 changed files with 5 additions and 2 deletions

View File

@ -1,8 +1,8 @@
@using AyCode.Blazor.Components.Components.Grids
<MgGridToolbarBase @ref="GridToolbar" Grid="Grid" ItemRenderStyleMode="ToolbarRenderStyleMode.Plain" ShowOnlyIcon="ShowOnlyIcon">
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "New")" Click="NewItem_Click" IconCssClass="grid-new-row" Visible="@(!IsEditing)" Enabled="@(!IsSyncing)" />
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "Edit")" Click="EditItem_Click" IconCssClass="grid-edit-row" Visible="@(!IsEditing)" Enabled="@(HasFocusedRow && !IsSyncing)" />
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "New")" Click="NewItem_Click" IconCssClass="grid-new-row" Visible="@(!IsEditing)" Enabled="@(EnableNew && !IsSyncing)" />
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "Edit")" Click="EditItem_Click" IconCssClass="grid-edit-row" Visible="@(!IsEditing)" Enabled="@(EnableEdit && HasFocusedRow && !IsSyncing)" />
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "Delete")" Click="DeleteItem_Click" IconCssClass="grid-delete-row" Visible="@(!IsEditing)" Enabled="@(EnableDelete && HasFocusedRow && !IsSyncing)" />
<DxToolbarItem Text="@(ShowOnlyIcon ? "" : "Save")" Click="SaveItem_Click" IconCssClass="grid-save" Visible="@IsEditing" RenderStyle="ButtonRenderStyle.Primary" />
@ -40,7 +40,10 @@
[Parameter] public IMgGridBase Grid { get; set; } = null!;
[Parameter] public RenderFragment? ToolbarItemsExtended { get; set; }
[Parameter] public EventCallback<ToolbarItemClickEventArgs> 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!;