|
|
@ -1,5 +1,6 @@
|
|
|
|
using BlazorApp1.Components;
|
|
|
|
using BlazorApp1.Components;
|
|
|
|
using BlazorApp1.Models;
|
|
|
|
using BlazorApp1.Models;
|
|
|
|
|
|
|
|
using Blazorise.DataGrid;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BlazorApp1.Pages
|
|
|
|
namespace BlazorApp1.Pages
|
|
|
@ -9,6 +10,7 @@ namespace BlazorApp1.Pages
|
|
|
|
[Inject]
|
|
|
|
[Inject]
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int totalItem;
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
@ -24,5 +26,18 @@ namespace BlazorApp1.Pages
|
|
|
|
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
StateHasChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private async Task OnReadData(DataGridReadDataEventArgs<Item> e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (e.CancellationToken.IsCancellationRequested)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!e.CancellationToken.IsCancellationRequested)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Items = await DataService.List(e.Page, e.PageSize);
|
|
|
|
|
|
|
|
totalItem = await DataService.Count();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|