Fix Pager component issue which manifested itself in Event Log. This reverts a fix from #1160 and addresses the root problem.

This commit is contained in:
Shaun Walker
2021-03-11 11:21:47 -05:00
parent ed12194ea2
commit 6d3e17a5f5
2 changed files with 18 additions and 26 deletions

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Controls
@namespace Oqtane.Modules.Controls
@inherits ModuleControlBase
@typeparam TableItem
@ -114,10 +114,10 @@
@code {
private int _pages = 0;
private int _page = 1;
private int _maxItems;
private int _maxPages;
private int _startPage;
private int _endPage;
private int _maxItems = 10;
private int _maxPages = 5;
private int _startPage = 0;
private int _endPage = 0;
[Parameter]
public string Format { get; set; }
@ -172,24 +172,20 @@
}
}
if (string.IsNullOrEmpty(PageSize))
{
_maxItems = 10;
}
else
if (!string.IsNullOrEmpty(PageSize))
{
_maxItems = int.Parse(PageSize);
}
if (string.IsNullOrEmpty(DisplayPages))
{
_maxPages = 5;
}
else
if (!string.IsNullOrEmpty(DisplayPages))
{
_maxPages = int.Parse(DisplayPages);
}
_page = 1;
_startPage = 0;
_endPage = 0;
if (Items != null)
{
ItemList = Items.Skip((_page - 1) * _maxItems).Take(_maxItems);