Skip to content

Commit

Permalink
Blazor: Update Pagination Component
Browse files Browse the repository at this point in the history
  • Loading branch information
phongnguyend committed Jun 28, 2024
1 parent 9c63527 commit 48297f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<ul class="pagination">
<li class="page-item @(CurrentPage==1?"disabled":"")"><a class="page-link" href="javascript:void(0)" @onclick="() => HandleClick(1)">First</a></li>
<li class="page-item @(CurrentPage==1?"disabled":"")"><a class="page-link" href="javascript:void(0)" @onclick="() => HandleClick(CurrentPage - 1)">Previous</a></li>
<li class="page-item @(CurrentPage==1?"disabled":"")"><a class="page-link" @onclick="() => HandleClick(1)">First</a></li>
<li class="page-item @(CurrentPage==1?"disabled":"")"><a class="page-link" @onclick="() => HandleClick(CurrentPage - 1)">Previous</a></li>
@foreach (var pageNumber in PageNumbers)
{
<li class="page-item @(CurrentPage==pageNumber?"active":"")"><a class="page-link" href="javascript:void(0)" @onclick="() => HandleClick(pageNumber)">@pageNumber</a></li>
<li class="page-item @(CurrentPage==pageNumber?"active":"")"><a class="page-link" @onclick="() => HandleClick(pageNumber)">@pageNumber</a></li>
}
<li class="page-item @(CurrentPage==TotalPages?"disabled":"")"><a class="page-link" href="javascript:void(0)" @onclick="() => HandleClick(CurrentPage + 1)">Next</a></li>
<li class="page-item @(CurrentPage==TotalPages?"disabled":"")"><a class="page-link" href="javascript:void(0)" @onclick="() => HandleClick(TotalPages)">Last</a></li>
<li class="page-item @(CurrentPage==TotalPages?"disabled":"")"><a class="page-link" @onclick="() => HandleClick(CurrentPage + 1)">Next</a></li>
<li class="page-item @(CurrentPage==TotalPages?"disabled":"")"><a class="page-link" @onclick="() => HandleClick(TotalPages)">Last</a></li>
</ul>

@code {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a {
cursor: pointer;
}

0 comments on commit 48297f7

Please sign in to comment.