CurrPage:

- riporto a 1 se cambio filtro
- sbaglia primo cambio da sel DataPager
This commit is contained in:
Samuele Locatelli
2022-09-15 18:01:25 +02:00
parent 7cc25ac9be
commit ae39db267d
3 changed files with 46 additions and 52 deletions
+36 -33
View File
@@ -23,7 +23,6 @@ namespace MP.SPEC.Components
#region Protected Properties
protected bool liveUpdate
{
get => SelFilter.LiveUpdate;
@@ -51,11 +50,35 @@ namespace MP.SPEC.Components
{
if (!SelFilter.CodFlux.Equals(value))
{
SelFilter.CurrPage = 1;
SelFilter.CodFlux = value;
reportChange();
}
}
}
protected string selMacchina
{
get
{
return SelFilter.IdxMacchina;
}
set
{
if (!SelFilter.IdxMacchina.Equals(value))
{
SelFilter.CurrPage = 1;
SelFilter.IdxMacchina = value;
SelFilter.CodFlux = "*";
ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
protected int selMaxRecord
{
get
@@ -72,6 +95,7 @@ namespace MP.SPEC.Components
}
}
}
protected int selTempoAgg
{
get
@@ -90,30 +114,6 @@ namespace MP.SPEC.Components
}
}
protected string selMacchina
{
get
{
return SelFilter.IdxMacchina;
}
set
{
if (!SelFilter.IdxMacchina.Equals(value))
{
Task.Delay(1);
//StateHasChanged();
SelFilter.IdxMacchina = value;
SelFilter.CodFlux = "*";
ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
Task.Delay(1);
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
#endregion Protected Properties
#region Protected Methods
@@ -125,6 +125,11 @@ namespace MP.SPEC.Components
ListFlux = await MDService.ParametriGetFilt(selMacchina);
}
protected void toggleParams()
{
showEditPar = !showEditPar;
}
protected async Task toggleUpdate()
{
liveUpdate = !liveUpdate;
@@ -137,21 +142,19 @@ namespace MP.SPEC.Components
#endregion Protected Methods
protected void toggleParams()
{
showEditPar = !showEditPar;
}
#region Private Fields
private bool showEditPar { get; set; } = false;
private List<string>? ListFlux;
private List<string>? ListMacchine;
#endregion Private Fields
#region Private Properties
private bool showEditPar { get; set; } = false;
#endregion Private Properties
#region Private Methods
private async Task reloadFiltFlux()
+5 -1
View File
@@ -17,6 +17,7 @@
public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 2000;
public int CurrPage { get; set; } = 1;
#endregion Public Properties
@@ -38,10 +39,13 @@
if (MaxRecord != item.MaxRecord)
return false;
if (TempoAgg != item.TempoAgg)
return false;
if (CurrPage != item.CurrPage)
return false;
return true;
}
+5 -18
View File
@@ -61,13 +61,7 @@ namespace MP.SPEC.Pages
MsgService.ShowSearch = false;
// resetto search
MsgService.SearchVal = "";
#if false
// carico dati
lastUpdate = $"Updated: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
await reloadFilters();
await reloadData();
#endif
await Task.Delay(1);
isLoading = false;
}
@@ -144,19 +138,12 @@ namespace MP.SPEC.Pages
{
isLoading = true;
currFilter = newParams;
currFilter.LiveUpdate = !currFilter.LiveUpdate;
#if false
liveUpdate = newParams.LiveUpdate;
#endif
currFilter.LiveUpdate = false;
currPage = newParams.CurrPage;
//currFilter.LiveUpdate = !currFilter.LiveUpdate;
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
//await Task.Delay(1);
#if false
selMacchina = newParams.IdxMacchina;
selFlux = newParams.CodFlux;
//ForceReloadPage();
await InvokeAsync(() => StateHasChanged());
#endif
isLoading = false;
}