Browse Source

change page toolbar call order.

pull/6647/head
Ilkay Ilknur 6 years ago
parent
commit
d76b7a6b38
  1. 14
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
  2. 16
      framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs

14
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components; using System;
using Microsoft.AspNetCore.Components;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars; using Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars;
@ -39,12 +40,14 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout
ToolbarItemRenders = new List<RenderFragment>(); ToolbarItemRenders = new List<RenderFragment>();
} }
protected override async Task OnInitializedAsync() protected override async Task OnParametersSetAsync()
{ {
await base.OnParametersSetAsync();
if (Toolbar!=null) if (Toolbar!=null)
{ {
Console.WriteLine("Toolbar is not null");
var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar); var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar);
Console.WriteLine($"Toolbar item count:{toolbarItems.Length}");
ToolbarItemRenders.Clear(); ToolbarItemRenders.Clear();
foreach (var item in toolbarItems) foreach (var item in toolbarItems)
@ -66,5 +69,10 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout
} }
} }
} }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
}
} }
} }

16
framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs

@ -217,10 +217,21 @@ namespace Volo.Abp.BlazoriseUI
await SetPermissionsAsync(); await SetPermissionsAsync();
await SetEntityActionsAsync(); await SetEntityActionsAsync();
await SetTableColumnsAsync(); await SetTableColumnsAsync();
await SetToolbarItemsAsync(); await InvokeAsync(StateHasChanged);
await SetBreadcrumbItemsAsync(); }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await base.OnAfterRenderAsync(firstRender);
await SetToolbarItemsAsync();
await SetBreadcrumbItemsAsync();
}
} }
protected virtual async Task SetPermissionsAsync() protected virtual async Task SetPermissionsAsync()
{ {
if (CreatePolicyName != null) if (CreatePolicyName != null)
@ -477,6 +488,7 @@ namespace Volo.Abp.BlazoriseUI
await AppService.DeleteAsync(entity.Id); await AppService.DeleteAsync(entity.Id);
await GetEntitiesAsync(); await GetEntitiesAsync();
await InvokeAsync(StateHasChanged);
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save