|
@@ -140,6 +140,7 @@
|
|
|
showColumns: false,
|
|
showColumns: false,
|
|
|
showRefresh: false,
|
|
showRefresh: false,
|
|
|
showToggle: false,
|
|
showToggle: false,
|
|
|
|
|
+ smartDisplay: false,
|
|
|
minimumCountColumns: 1,
|
|
minimumCountColumns: 1,
|
|
|
idField: undefined,
|
|
idField: undefined,
|
|
|
cardView: false,
|
|
cardView: false,
|
|
@@ -710,8 +711,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$.each(pageList, function (i, page) {
|
|
$.each(pageList, function (i, page) {
|
|
|
- var active = page === that.options.pageSize ? ' class="active"' : '';
|
|
|
|
|
- pageNumber.push(sprintf('<li%s><a href="javascript:void(0)">%s</a></li>', active, page));
|
|
|
|
|
|
|
+ if (that.options.smartDisplay === false || that.options.totalRows >= page || page == pageList[0]) {
|
|
|
|
|
+ var active = page === that.options.pageSize ? ' class="active"' : '';
|
|
|
|
|
+ pageNumber.push(sprintf('<li%s><a href="javascript:void(0)">%s</a></li>', active, page));
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
pageNumber.push('</ul></span>');
|
|
pageNumber.push('</ul></span>');
|
|
|
|
|
|
|
@@ -768,6 +771,14 @@
|
|
|
$next.addClass('disabled');
|
|
$next.addClass('disabled');
|
|
|
$last.addClass('disabled');
|
|
$last.addClass('disabled');
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this.options.smartDisplay) {
|
|
|
|
|
+ if (this.totalPages <= 1) {
|
|
|
|
|
+ this.$pagination.find('div.pagination').hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.options.totalRows <= this.options.pageList[1]) {
|
|
|
|
|
+ this.$pagination.find('div.pagination-detail').hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
$pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
|
|
$pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
|
|
|
$first.off('click').on('click', $.proxy(this.onPageFirst, this));
|
|
$first.off('click').on('click', $.proxy(this.onPageFirst, this));
|
|
|
$pre.off('click').on('click', $.proxy(this.onPagePre, this));
|
|
$pre.off('click').on('click', $.proxy(this.onPagePre, this));
|