Merge pull request #160 from fileman/FixPagerAfterDeletePage

Fix for PageStart > EndPage after delete and don't reset value of Page
This commit is contained in:
Shaun Walker
2019-10-25 12:27:48 -04:00
committed by GitHub

View File

@ -44,7 +44,7 @@
@code { @code {
int Pages = 0; int Pages = 0;
int Page; int Page = 1;
int MaxItems; int MaxItems;
int MaxPages; int MaxPages;
int StartPage; int StartPage;
@ -85,7 +85,6 @@
{ {
MaxPages = int.Parse(DisplayPages); MaxPages = int.Parse(DisplayPages);
} }
Page = 1;
if (Items != null) if (Items != null)
{ {
@ -106,8 +105,16 @@
public void SetPagerSize(string direction) public void SetPagerSize(string direction)
{ {
if (direction == "forward") if (direction == "forward")
{
if (EndPage + 1 < Pages)
{ {
StartPage = EndPage + 1; StartPage = EndPage + 1;
}
else
{
StartPage = 1;
}
if (EndPage + MaxPages < Pages) if (EndPage + MaxPages < Pages)
{ {
EndPage = StartPage + MaxPages - 1; EndPage = StartPage + MaxPages - 1;