Fix catena update pagina
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="row p-2 m-2">
|
||||
<div class="col-12 text-center mt-2 py-2 alert alert-primary">
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-12 text-center py-2 mb-0 alert alert-primary">
|
||||
<b>loading data</b>
|
||||
<i class="fas fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,14 @@
|
||||
<h3><b>PARAMETERS</b></h3>
|
||||
</div>
|
||||
<div class="px-2 flex-fill">
|
||||
<ParamsFilter FilterChanged="updateFilter"></ParamsFilter>
|
||||
@if (isFiltering)
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ParamsFilter FilterChanged="updateFilter"></ParamsFilter>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,15 +33,24 @@ namespace MP.SPEC.Pages
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
isFiltering = true;
|
||||
#if false
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
#endif
|
||||
// disabilito ricerca...
|
||||
MsgService.SearchVal = "";
|
||||
MsgService.ShowSearch = false;
|
||||
// fix pagina
|
||||
currFilter.CurrPage = 1;
|
||||
currFilter.LiveUpdate = (currPage == 1);
|
||||
await Task.Delay(1);
|
||||
var modFilter = currFilter;
|
||||
modFilter.CurrPage = 1;
|
||||
modFilter.LiveUpdate = (currPage == 1);
|
||||
currFilter = modFilter;
|
||||
await Task.Delay(1);
|
||||
isFiltering = false;
|
||||
}
|
||||
|
||||
protected async Task pgResetReq(bool doReset)
|
||||
@@ -75,6 +84,7 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = true;
|
||||
private bool isFiltering { get; set; } = false;
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
@@ -90,20 +100,22 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private async Task updateFilter(SelectFluxParams newParams)
|
||||
{
|
||||
isFiltering = false;
|
||||
isLoading = true;
|
||||
currFilter = newParams;
|
||||
await Task.Delay(1);
|
||||
currPage = 1;
|
||||
if (newParams.CurrPage == 0)
|
||||
{
|
||||
currFilter.CurrPage = 1;
|
||||
currFilter.LiveUpdate = false;
|
||||
newParams.CurrPage = 1;
|
||||
newParams.LiveUpdate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
currFilter.LiveUpdate = (currPage == 1);
|
||||
newParams.LiveUpdate = (currPage == 1);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
currFilter = newParams;
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user