-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
设置 totalCounts 为 0 时,会提示该值是必填项。 #30
Comments
目前的分页逻辑,没有考虑这种情况,因为 |
不该显示是吧?是我自己先判断记录总数为 0 在情形下,采用诸如 hide() 方法去隐藏分页栏吗? |
当totalCounts 为 0 的时候,分页是不显示,但是在控制台会打印totalCounts不能为空的错误 |
@lirenhao 因为 totalCounts 不能为空 |
当totalCounts 为 0 的时候,还是报[jqPaginator] totalCounts or totalPages is required |
if (!opts.totalPages && !opts.totalCounts) {
throw new Error('[jqPaginator] totalCounts or totalPages is required');
} 就是这样判断的。 |
这是错误的,当totalPages或totalCounts等于0时, (!opts.totalPages && !opts.totalCounts)是true |
我认为应该在下列选项中选择一个: |
环境信息
代码片段:
$("#tablePagination").jqPaginator({
totalCounts: 0,
pageSize: globalProperty.pageSize,
visiblePages: 10,
currentPage: globalProperty.pageIndex_default,
first: '
prev: '
next: '
last: '
page: '
onPageChange: function (currentPageIndex) {
//getData({
// currentPageIndex: currentPageIndex,
// fieldName: globalProperty.sort_fieldName,
// fieldOrder: globalProperty.sort_fieldOrder
//});
}
});
我觉得设置 totalCounts 为 0 应当是合理的,毕竟来自服务端的记录总有为 0 条的情形。
The text was updated successfully, but these errors were encountered: