Update comportamento DataPager + fix display vert
This commit is contained in:
@@ -139,15 +139,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h4>Max 4 pages</h4>
|
||||
<DataPager currPage="1" totalCount="@numero" NumPages="4" DisplSize="DataPager.ObjSize.small"></DataPager>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h4>Std 10 pages</h4>
|
||||
<DataPager currPage="1" totalCount="@numero"></DataPager>
|
||||
<span class="form-check form-switch">
|
||||
<label class="form-check-label">Small Pager</label>
|
||||
<input class="form-check-input" type="checkbox" @bind="@ShowSmallPager">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
@if(ShowSmallPager)
|
||||
{
|
||||
<DataPager currPage="1" totalCount="@numero" NumPages="4" DisplSize="DataPager.ObjSize.small"></DataPager>
|
||||
}
|
||||
else
|
||||
{
|
||||
<DataPager currPage="1" totalCount="@numero"></DataPager>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -162,6 +170,8 @@
|
||||
private int qsIntero = -1;
|
||||
private int numero = 0;
|
||||
|
||||
private bool ShowSmallPager { get; set; } = false;
|
||||
|
||||
protected Random rnd = new Random();
|
||||
|
||||
protected override void OnInitialized()
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<div class="d-flex justify-content-between align-content-center @cssSize">
|
||||
<div class="d-flex justify-content-between align-items-center align-content-center @cssSize">
|
||||
<div class="px-0">
|
||||
<div class="row">
|
||||
<div class="col-12 @cssSize">
|
||||
@if (totalCount > 0)
|
||||
{
|
||||
<ul class="pagination pagination-sm mb-1">
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)"><i class="fas fa-angle-double-left"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)"><i class="fas fa-angle-left"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)" title="@TxtStart"><i class="fas fa-angle-double-left"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)" title="@TxtPrev"><i class="fas fa-angle-left"></i></button></li>
|
||||
@for (int i = @startPage; i <= endPage; ++i)
|
||||
{
|
||||
var pageNum = i;
|
||||
<li class="page-item @cssActive(pageNum)"><button class="page-link" @onclick="() => PaginationItemClick(pageNum)">@pageNum</button></li>
|
||||
}
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)"><i class="fas fa-angle-right"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)"><i class="fas fa-angle-double-right"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)" title="@TxtNext"><i class="fas fa-angle-right"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)" title="@TxtEnd"><i class="fas fa-angle-double-right"></i></button></li>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<div class="d-flex">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="p-1 flex-fill text-end">
|
||||
@if (!showLoading)
|
||||
{
|
||||
|
||||
@@ -74,6 +74,28 @@ namespace EgwCoreLib.Razor
|
||||
[Parameter]
|
||||
public int NumPages { get; set; } = 10;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test btn vai a inizio
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string TxtStart { get; set; } = "Start";
|
||||
/// <summary>
|
||||
/// Test btn vai a fine
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string TxtEnd { get; set; } = "End";
|
||||
/// <summary>
|
||||
/// Test btn vai a PrevBlock
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string TxtPrev { get; set; } = "Prev";
|
||||
/// <summary>
|
||||
/// Test btn vai a NextBlock
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string TxtNext{ get; set; } = "Next";
|
||||
|
||||
/// <summary>
|
||||
/// PageSize = Num record da mostrare cambiato
|
||||
/// </summary>
|
||||
@@ -236,7 +258,7 @@ namespace EgwCoreLib.Razor
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / NumPages) * NumPages + NumPages;
|
||||
int answ = startPage + NumPages -1;
|
||||
answ = answ < LastPage ? answ : LastPage;
|
||||
return answ;
|
||||
}
|
||||
@@ -277,7 +299,7 @@ namespace EgwCoreLib.Razor
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / NumPages) * NumPages;
|
||||
int answ = ((int)((currPage -1) / NumPages) ) * NumPages + 1;
|
||||
answ = answ > 0 ? answ : 1;
|
||||
return answ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user