diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor b/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor index b656a551f9..2324311c46 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor @@ -2,141 +2,283 @@ @using MudBlazor @using Volo.Abp.Data - - - - - - - @UiLocalizer["NoDataAvailableInDatatable"] - - - - @if (Columns != null) - { - @foreach (var column in Columns) +@if (ServerData is not null) +{ + + + + + + + @UiLocalizer["NoDataAvailableInDatatable"] + + + + @if (Columns != null) { - if (column.Actions.Any()) + @foreach (var column in Columns) { - var entityActionType = column.Actions.Count == 1 ? MudActionType.Button : MudActionType.Dropdown; - - - - @foreach (var action in column.Actions) - { - if (action.ConfirmationMessage != null) - { - - - } - else - { - - - } - } - - - - } - else - { - @if (column.Component != null) + if (column.Actions.Any()) { - + + @if (ShowPager) + { + + } + + +} +else +{ + + + + + + + @UiLocalizer["NoDataAvailableInDatatable"] + + + + @if (Columns != null) + { + @foreach (var column in Columns) + { + if (column.Actions.Any()) + { + var entityActionType = column.Actions.Count == 1 ? MudActionType.Button : MudActionType.Dropdown; + + + + @foreach (var action in column.Actions) + { + if (action.ConfirmationMessage != null) + { + + + } else { - if (column.ValueConverter != null) + + + } + } + + + + } + else + { + @if (column.Component != null) + { + + } + else + { + if (!ExtensionPropertiesRegex.IsMatch(column.Data)) + { + @if (column.ValueConverter == null) + { + - - @if (ShowPager) - { - - } - - + + + @if (ShowPager) + { + + } + + +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor index 96932a8f23..92eeb8854b 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor +++ b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor @@ -3,31 +3,30 @@ @if (Visible && HasPermission) { - if (ParentActions.Type == MudActionType.Dropdown) + if (ParentActions != null) { - if (Primary == false) + if (ParentActions.Type == MudActionType.Dropdown) { - + if (Primary == false) + { + + @if (!string.IsNullOrEmpty(Icon)) + { + + } + @Text + + } + } + else + { + @if (!string.IsNullOrEmpty(Icon)) { - + } @Text - + } } - else - { - - @if (!string.IsNullOrEmpty(Icon)) - { - - } - @Text - - } } diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs index 4f6b5b404c..ffb1d4c0ba 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs +++ b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs @@ -40,7 +40,7 @@ public partial class MudEntityAction : ComponentBase public string? Icon { get; set; } [CascadingParameter] - public MudEntityActions ParentActions { get; set; } = default!; + public MudEntityActions? ParentActions { get; set; } = default!; [Inject] protected IAuthorizationService AuthorizationService { get; set; } = default!; @@ -60,7 +60,10 @@ public partial class MudEntityAction : ComponentBase } #pragma warning restore CS0618 - ParentActions.AddAction(this); + if (ParentActions != null) + { + ParentActions.AddAction(this); + } } protected internal virtual async Task ActionClickedAsync()