Fix paginatore sul cambio pagina
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<span aria-hidden="true">«</span>
|
||||
</PaginationLink>
|
||||
</PaginationItem>
|
||||
@for (int i = 1; i <= LastPage; ++i)
|
||||
@for (int i = @startPage; i <= endPage; ++i)
|
||||
{
|
||||
var pageNum = i;
|
||||
<PaginationItem Active="@(currPage.Equals(pageNum))">
|
||||
@@ -57,6 +57,28 @@
|
||||
reportChangePage();
|
||||
}
|
||||
|
||||
private int numPages { get; set; } = 10;
|
||||
|
||||
// calcola un set 1..numPOages centrato sulla pagina corrente...
|
||||
private int startPage
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / numPages) * numPages - 2;
|
||||
answ = answ > 0 ? answ : 1;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
private int endPage
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / numPages) * numPages + numPages + 2;
|
||||
answ = answ < LastPage ? answ : LastPage;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private int LastPage
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user