fix(Table): ItemChangedType doesn't pass correct value to EditTemplate on Drawer mode (#4750)
Some checks are pending
Build docker image / docker (push) Waiting to run
Package to Nuget / pack (push) Waiting to run

* feat(Table): add cascade value ItemChagnedType for edit template

* chore: bump version 9.0.2-beta04
This commit is contained in:
Argo Zhang 2024-11-27 18:08:13 -08:00 committed by GitHub
parent 81e8297038
commit 341ffda446
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 20 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Version>9.0.2-beta03</Version>
<Version>9.0.2-beta04</Version>
</PropertyGroup>
<ItemGroup>

View File

@ -4,24 +4,26 @@
@attribute [BootstrapModuleAutoLoader("Dialog/EditDialog.razor.js", AutoInvokeInit = false, AutoInvokeDispose = false)]
<ValidateForm Model="@Model" OnValidSubmit="@OnValidSubmitAsync" DisableAutoSubmitFormByEnter="@DisableAutoSubmitFormByEnter">
@if (BodyTemplate != null)
{
<div class="form-body">
@BodyTemplate(Model)
</div>
<div class="form-footer">
@RenderFooter
</div>
}
else
{
<EditorForm TModel="TModel" Items="Items" ItemChangedType="ItemChangedType" ItemsPerRow="ItemsPerRow" RowType="RowType" LabelAlign="LabelAlign" ShowLabel="ShowLabel" ShowUnsetGroupItemsOnTop="ShowUnsetGroupItemsOnTop">
<Buttons>
<CascadingValue Value="ItemChangedType" IsFixed="true">
@if (BodyTemplate != null)
{
<div class="form-body">
@BodyTemplate(Model)
</div>
<div class="form-footer">
@RenderFooter
</Buttons>
</EditorForm>
}
<div class="form-loader fade" id="@Id">
<Spinner Color="Color.Primary" />
</div>
</div>
}
else
{
<EditorForm TModel="TModel" Items="Items" ItemChangedType="ItemChangedType" ItemsPerRow="ItemsPerRow" RowType="RowType" LabelAlign="LabelAlign" ShowLabel="ShowLabel" ShowUnsetGroupItemsOnTop="ShowUnsetGroupItemsOnTop">
<Buttons>
@RenderFooter
</Buttons>
</EditorForm>
}
<div class="form-loader fade" id="@Id">
<Spinner Color="Color.Primary" />
</div>
</CascadingValue>
</ValidateForm>