57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using Radzen;
|
|
|
|
namespace Lux.UI.Components.Compo.Config
|
|
{
|
|
public partial class ProfDataDetail
|
|
{
|
|
|
|
[Parameter]
|
|
public Dictionary<string, double> AllRecords { get; set; } = null!;
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_ReqClose { get; set; }
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
isLoading = true;
|
|
UpdateTable();
|
|
}
|
|
|
|
protected void UpdateTable()
|
|
{
|
|
totalCount = AllRecords.Count;
|
|
ListRecords = AllRecords
|
|
.OrderBy(x => x.Key)
|
|
.Skip(numRecord * (currPage - 1))
|
|
.Take(numRecord)
|
|
.ToDictionary(x => x.Key, x => x.Value);
|
|
|
|
isLoading = false;
|
|
}
|
|
protected void SaveNumRec(int newNum)
|
|
{
|
|
isLoading = true;
|
|
numRecord = newNum;
|
|
currPage = 1;
|
|
UpdateTable();
|
|
}
|
|
|
|
protected void SavePage(int newNum)
|
|
{
|
|
isLoading = true;
|
|
currPage = newNum;
|
|
UpdateTable();
|
|
}
|
|
protected Dictionary<string, double>? ListRecords = null;
|
|
|
|
private bool isLoading = false;
|
|
private int currPage = 1;
|
|
private int totalCount = 0;
|
|
private int numRecord = 10;
|
|
|
|
private async Task DoClose(MouseEventArgs args)
|
|
{
|
|
await EC_ReqClose.InvokeAsync(true);
|
|
}
|
|
}
|
|
} |