diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs index 2f800c7257..837eb2c96a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs @@ -12,6 +12,7 @@ public class EntityAction : IEquatable public object Color { get; set; } public string Icon { get; set; } public Func Visible { get; set; } + public bool Disabled { get; set; } public bool Equals(EntityAction other) { return string.Equals(Text, other?.Text, StringComparison.OrdinalIgnoreCase); diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index 459e47f442..39a86456b8 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -44,7 +44,8 @@ Clicked="async () => await action.Clicked(context)" ConfirmationMessage="() => action.ConfirmationMessage.Invoke(context)" Visible="@(action.Visible != null ? action.Visible(context) : true)" - Text="@action.Text"> + Text="@action.Text" + Disabled="@action.Disabled"> } else @@ -54,7 +55,8 @@ Color="@(action.Color != null ? (Blazorise.Color) action.Color : Blazorise.Color.None)" Icon="@action.Icon" Visible="@(action.Visible != null ? action.Visible(context) : true)" - Text="@action.Text"> + Text="@action.Text" + Disabled="@action.Disabled"> } } @@ -78,18 +80,18 @@ { @if (column.ValueConverter == null) { - } else { - @(GetConvertedFieldValue(context, column)) @@ -143,4 +145,4 @@ } } - \ No newline at end of file + diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor index 8e4544e09c..63b0f26df0 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor @@ -6,14 +6,15 @@ { if (Primary == false) { - @Text + @Text } } else { } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs index 627c4bcdda..a38d915ff1 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs @@ -12,6 +12,9 @@ public partial class EntityAction : ComponentBase [Parameter] public bool Visible { get; set; } = true; + [Parameter] + public bool Disabled { get; set; } = false; + internal bool HasPermission { get; set; } = true; [Parameter] @@ -45,7 +48,7 @@ public partial class EntityAction : ComponentBase [Inject] protected IUiMessageService UiMessageService { get; set; } - protected override async Task OnInitializedAsync() + protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); await SetDefaultValuesAsync(); diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor index 7a2fd20145..b362358d70 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor @@ -2,12 +2,13 @@ @if ( Type == ActionType.Dropdown ) { - + @if ( HasPrimaryAction ) { @@ -27,4 +28,4 @@ { @ChildContent } - \ No newline at end of file + diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs index e6a7ff9c83..4ba27bf2f7 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs @@ -29,6 +29,9 @@ public partial class EntityActions : ComponentBase [Parameter] public ActionType Type { get; set; } = ActionType.Dropdown; + [Parameter] + public bool Disabled { get; set; } = false; + [CascadingParameter] public DataGridEntityActionsColumn ParentEntityActionsColumn { get; set; } @@ -46,7 +49,7 @@ public partial class EntityActions : ComponentBase ToggleText = UiLocalizer["Actions"]; } - protected override async Task OnAfterRenderAsync(bool firstRender) + protected async override Task OnAfterRenderAsync(bool firstRender) { if (firstRender) {