In jqgrid, when there are 6 records (Paging 5). So, first page has 5 records and second page has 1 record now, user has deleted 6th record (from page #2). Then, grid still remains on page #2 and no rows exists on page 2 as its deleted. It does not look good when 5 records on page 1 and no records on page 2 though, page selection appeared on page 2.
Can you please guide how to solve that. i think, it should be move to earlier page (last page).
Also, related issue: when all 6 records are deleted. then, grid still appear. Insted of that, there should be some label message to appear as no records exists. How to achieve this ?
You can use
reccount
options which provides the number or records on the current page of the grid. If the number of records is 0 you can do additional action. For example you can triggerreloadGrid
with additionalpage
option (see the answer)If you need to display some message text in the grid body you can follow the demo created for the answer. The demo just shows div with the message text in case of
reccount === 0
.