fix paginazione e ricerca

This commit is contained in:
zaccaria.majid
2022-09-12 16:26:30 +02:00
parent 014bed96f9
commit dd56701b5b
7 changed files with 31 additions and 7 deletions
+5
View File
@@ -23,6 +23,11 @@ namespace MP.SPEC.Components
}
}
}
public async Task resetCurrPage()
{
currPage = 1;
}
[Parameter]
public EventCallback<int> numPageChanged { get; set; }
+5 -1
View File
@@ -71,7 +71,8 @@ namespace MP.SPEC.Components
{
await InvokeAsync(() =>
{
currPage = 1;
PagerResetReq.InvokeAsync(true);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
@@ -87,6 +88,9 @@ namespace MP.SPEC.Components
#region Private Fields
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
private string _statoSel = "*";
private ODLModel? currRecord = null;
+5 -1
View File
@@ -71,7 +71,8 @@ namespace MP.SPEC.Components
{
await InvokeAsync(() =>
{
currPage = 1;
PagerResetReq.InvokeAsync(true);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
@@ -87,6 +88,9 @@ namespace MP.SPEC.Components
#region Private Fields
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
private string _statoSel = "*";
private PODLModel? currRecord = null;
+1 -1
View File
@@ -104,7 +104,7 @@
{
if (_totalCount != value)
{
_totalCount = value
_totalCount = value;
}
}
}
+3 -3
View File
@@ -34,15 +34,15 @@
<div class="card-body">
@if (showCurrent)
{
<ListODL StatoSel="@selStato"></ListODL>
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListODL>
}
else
{
<ListPODL></ListPODL>
<ListPODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListPODL>
}
</div>
<div class="card-footer py-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+11
View File
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Pages
@@ -34,6 +35,16 @@ namespace MP.SPEC.Pages
currPage = newNum;
}
protected async Task pgResetReq(bool doReset)
{
if (doReset)
{
await pagerODL.resetCurrPage();
}
}
protected DataPager pagerODL;
protected override async Task OnInitializedAsync()
{
// abilito ricerca...