jsgrid
jsgrid copied to clipboard
Pagination disappears
Hi I have two pages in jsgrid. After deleting last item of 2nd page, the pagination gets disappear and the first page is not shown or getting redirected. Here's my code.
$("#jsGrid").jsGrid({
height: "500px",
width: "100%",
sorting: true,
paging: true,
deleteButton: true,
editing: false,
pagerContainer: null,
pageIndex: 1,
pageSize:20,
pageButtonCount: 15,
pagerFormat: "Pages: {first} {prev} {pages} {next} {last} {pageIndex} of {pageCount}",
pagePrevText: "Prev",
pageNextText: "Next",
pageFirstText: "First",
pageLastText: "Last",
pageNavigatorNextText: "...",
pageNavigatorPrevText: "...",
itemsCount: jsonobj.length,
data: jsonobj,
deleteItem: function (item) {
$.each(jsonobj, function (i, record) {
console.log(i);
if (record.SequenceNo === item.SequenceNo) {
jsonobj.splice(i, 1);
return false;
}
});
updateJsonobjSequence();
console.log(jsonobj);
$('#jsGrid').jsGrid('refresh');
},
insertItem: function (item) {
data: item
},
fields: [
{ name: "SequenceNo", type: "number", width: 50 },
{ name: "QRCodeText", type: "text", width: 150 },
{ type: "control" }
]
});
}