Browse Source

Show upper number in pageList display.

If totalRows is 45 and pageList is [25,50,100], we should be able to display the 45 rows.
Instead of that, we only can display 25 max, because 45 is not >= 50.
Timmy72 11 years ago
parent
commit
458c720bd9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -780,7 +780,7 @@
         }
         }
 
 
         $.each(pageList, function (i, page) {
         $.each(pageList, function (i, page) {
-            if (!that.options.smartDisplay || that.options.totalRows >= page || i === 0) {
+            if (!that.options.smartDisplay || i === 0 || pageList[i-1] <= that.options.totalRows) {
                 var active = page === that.options.pageSize ? ' class="active"' : '';
                 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(sprintf('<li%s><a href="javascript:void(0)">%s</a></li>', active, page));
             }
             }