fix paginazione e ricerca
This commit is contained in:
@@ -23,6 +23,11 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task resetCurrPage()
|
||||
{
|
||||
currPage = 1;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> numPageChanged { get; set; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value
|
||||
_totalCount = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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...
|
||||
|
||||
Reference in New Issue
Block a user