@if (totalCount > 0)
{
diff --git a/EgwCoreLib.Razor/DataPager.razor.cs b/EgwCoreLib.Razor/DataPager.razor.cs
index 5e974c8..2847550 100644
--- a/EgwCoreLib.Razor/DataPager.razor.cs
+++ b/EgwCoreLib.Razor/DataPager.razor.cs
@@ -4,6 +4,17 @@ namespace EgwCoreLib.Razor
{
public partial class DataPager : ComponentBase
{
+ #region Public Enums
+
+ public enum ObjSize
+ {
+ small,
+ standard,
+ large
+ }
+
+ #endregion Public Enums
+
#region Public Properties
///
@@ -27,6 +38,12 @@ namespace EgwCoreLib.Razor
}
}
+ ///
+ /// Dimensione controlli x resize
+ ///
+ [Parameter]
+ public ObjSize DisplSize { get; set; } = ObjSize.standard;
+
///
/// Export (csv) abilitato
///
@@ -38,21 +55,31 @@ namespace EgwCoreLib.Razor
///
[Parameter]
public EventCallback exportRequested { get; set; }
+
///
/// Filename x export
///
[Parameter]
public string fileName { get; set; } = "";
+
///
/// Evento cambio pagina nel paginatore
///
[Parameter]
public EventCallback numPageChanged { get; set; }
+
+ ///
+ /// Massimo numero di pagine da mostrare (x display piccoli)
+ ///
+ [Parameter]
+ public int NumPages { get; set; } = 10;
+
///
/// PageSize = Num record da mostrare cambiato
///
[Parameter]
public EventCallback numRecordChanged { get; set; }
+
///
/// Attuale PageSize
///
@@ -74,6 +101,15 @@ namespace EgwCoreLib.Razor
}
}
+ ///
+ /// Elenco dei PageSize ammessi
+ ///
+ [Parameter]
+ public List PageSizeList { get; set; } = new List()
+ {
+ 5,10,25,50,100
+ };
+
///
/// Fase di loading
///
@@ -98,21 +134,13 @@ namespace EgwCoreLib.Razor
_showLoading = value;
}
}
+
///
/// Totale record da mostrare
///
[Parameter]
public int totalCount { get; set; } = 0;
- ///
- /// Elenco dei PageSize ammessi
- ///
- [Parameter]
- public List PageSizeList { get; set; } = new List()
- {
- 5,10,25,50,100
- };
-
#endregion Public Properties
#region Public Methods
@@ -152,6 +180,28 @@ namespace EgwCoreLib.Razor
get => $"{exportDir}\\{fileName}";
}
+ private string cssSize
+ {
+ get
+ {
+ string answ = "";
+ switch (DisplSize)
+ {
+ case ObjSize.small:
+ answ = "small";
+ break;
+ case ObjSize.standard:
+ break;
+ case ObjSize.large:
+ answ = "large";
+ break;
+ default:
+ break;
+ }
+ return answ;
+ }
+ }
+
protected int percLoading { get; set; } = 0;
#endregion Protected Properties
@@ -186,7 +236,7 @@ namespace EgwCoreLib.Razor
{
get
{
- int answ = (int)(currPage / numPages) * numPages + numPages;
+ int answ = (int)(currPage / NumPages) * NumPages + NumPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
@@ -204,30 +254,30 @@ namespace EgwCoreLib.Razor
{
get
{
- int answ = currPage + numPages;
+ int answ = currPage + NumPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
}
- private int numPages { get; set; } = 10;
-
private int prevBlock
{
get
{
- int answ = currPage - numPages;
+ int answ = currPage - NumPages;
answ = answ > 0 ? answ : 1;
return answ;
}
}
- // calcola un set 1 .. numPages centrato sulla pagina corrente...
+ ///
+ /// calcola un set 1 .. NumPages centrato sulla pagina corrente...
+ ///
private int startPage
{
get
{
- int answ = (int)(currPage / numPages) * numPages;
+ int answ = (int)(currPage / NumPages) * NumPages;
answ = answ > 0 ? answ : 1;
return answ;
}