It would be great to have an option to auto-hide the pagination and stats when there's only one page of results. In the mean time, I wrote a JavaScript solution:
STEP 2. Add this JavaScript function (and JQuery) to your page:
function mvcGridHidePagination() {
$("div[id^='MVCGridTableHolder_'] ul.pagination").each(function (index) {
if ($(this).children().length == 3) {
$(this).parent().parent(".row").hide();
}
});
}
$(document).ready(function() {
mvcGridHidePagination();
});
This selector chooses all instances of the pagination list that only have three children (Prev, Next, and 1) and then navigates up two parents to the parent div with class ".row" and hides it. You have to run it on document load to hide them on page load. The MVCGrid event handles re-hiding if you sort, filter, etc. each grid.
It would be great to have an option to auto-hide the pagination and stats when there's only one page of results. In the mean time, I wrote a JavaScript solution:
STEP 1. In your grid config, add this option:
STEP 2. Add this JavaScript function (and JQuery) to your page:
This selector chooses all instances of the pagination list that only have three children (Prev, Next, and 1) and then navigates up two parents to the parent div with class ".row" and hides it. You have to run it on document load to hide them on page load. The MVCGrid event handles re-hiding if you sort, filter, etc. each grid.
Hope this helps someone else!