UI refresh fix
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
@using Drab.LocalDb.Entities
|
||||
@using Drab.Logic.Services
|
||||
@using Drab.Ui.Components
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Radzen
|
||||
@inject LocalDbContext LocalDbContext
|
||||
@inject DialogService DialogService
|
||||
@@ -64,13 +65,13 @@
|
||||
</RadzenDataGrid>
|
||||
|
||||
@code {
|
||||
IQueryable<OrderDb> _orders;
|
||||
List<OrderDb> _orders;
|
||||
private RadzenDataGrid<OrderDb>? _dataGridRef;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
EventBus.OrdersChanged += OnOrdersChanged;
|
||||
_orders = LocalDbContext.Orders;
|
||||
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||
}
|
||||
|
||||
private async Task RowClick(DataGridRowMouseEventArgs<OrderDb> obj)
|
||||
@@ -92,8 +93,7 @@
|
||||
{
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
_orders = LocalDbContext.Orders;
|
||||
_dataGridRef?.Reload();
|
||||
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||
_dataGridRef?.RefreshDataAsync();
|
||||
StateHasChanged();
|
||||
return Task.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user