Hi I have a html table with both grid view and list view my pagination jquery works on list view but not on grid view may i know how can I achieve it
here is my jquery and code
@model ExternalUI.Models.ProductCatalog.ProductsViewModel
@{
Layout = string.Empty;
bool row = true;
ExternalUI.Models.ProductCatalog.PaginationSettings paginationSettings = new ExternalUI.Models.ProductCatalog.PaginationSettings();
//passing itemsperpage between postbacks
var data1 = ViewBag.dataquantity;
if (data1 == "10")
{
paginationSettings.paginationPageAmount = 10;
}
else if (data1 == "25")
{
paginationSettings.paginationPageAmount = 25;
}
else
{
paginationSettings.paginationPageAmount = 50;
}
var data = paginationSettings.paginationPageAmount;
}
@if (Model.itemsPerPageFilter != null && @data == 50)
{
}
else
{
}
@if (Model.itemsPerPageFilter != null && @data == 25)
{
}
else
{
}
@if (Model.itemsPerPageFilter != null && @data == 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 = $('#gridView');
// 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();
var windowHeight = $(window).height();
}
});
});
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bikesh SrivastavaPosted Sep 13, 2016, 11:24 PM
Esakki MuthuPosted Sep 13, 2016, 9:35 AM