Hi,
I am using simple pagination plugin in my page however the problem is that data is coming in chunks. So I am not able to see the pages when I am clicking on items per page tab
below is my code. Please help
@model ExternalUI.Models.ProductCatalog.ProductsViewModel
@{
Layout = string.Empty;
bool row = true;
ExternalUI.Models.ProductCatalog.PaginationSettings paginationSettings = new ExternalUI.Models.ProductCatalog.PaginationSettings();
paginationSettings.paginationPageAmount = 50;
var data = paginationSettings.paginationPageAmount;
}
@if (Model.itemsPerPageFilter != null && Model.itemsPerPageFilter == "50")
{
}
else
{
}
@if (Model.itemsPerPageFilter != null && Model.itemsPerPageFilter == "25")
{
}
else
{
}
@if (Model.itemsPerPageFilter != null && Model.itemsPerPageFilter == "10")
{
}
else
{
}
@foreach (var item in Model.productOrderByValues)
{
if (Model.orderByFilter != null && Model.orderByFilter == item.Key)
{
}
else
{
}
}
@**@
@foreach (var product in Model.productViewModels)
{
if (row)
{
}
| @Model.productTitleField.Key | @bodyField.Key |
|---|---|
| @product.productData[Model.productTitleField.Value] | @if (product.productData.Keys.Contains(@bodyField.Value)) { if (bodyField.Key == "Status") { if (product.productData[bodyField.Value] == "41") { @: Buyer Review } else if (product.productData[bodyField.Value] == "53") { @: Product Info Change Review } } else { @product.productData[bodyField.Value] } } else { @: -- } |
$(function () {
var pageParts = $("table tbody tr");
// How many parts do we have?
var numPages = pageParts.length;
// How many parts do we want per page?
var perPage = @data;
// When the document loads we're on page 1
// So to start with... hide everything else
pageParts.slice(perPage).hide();
$('#productMenu1').pagination({
items: numPages,
itemsOnPage: perPage,
cssStyle: "light-theme",
// We implement the actual pagination
// in this next function. It runs on
// the event that a user changes page
onPageClick: function (pageNum) {
// Which page parts do we show?
var start = perPage * (pageNum - 1);
var end = start + perPage;
// First hide all page parts
// Then show those just for our page
pageParts.hide()
.slice(start, end).show();
}
});
});
Replies
Know the answer? Post it — somebody with the same question will find it here.