浏览代码

Make pageList "All" option locale independant

With current implementation, having the "All" option in the pageList requires declaring it in the table options with the same locale as the one used at runtime. This might be an issue when the local is chosen dynamically depending on client configuration.

For instance, if locale is fr-FR, pageList = [ 10, 25, all ] will show [10, 25, NaN] in the page list, and pageList = [ 10, 25, tous ] will show a proper list. But pageList = [ 10, 25, tous ] will display [10, 25, NaN] if locale is en-US.

This change allows to have the option in every locale when it is declared in english. pageList = [ 10, 25, all ] will show [10,25,Tous] with fr-FR, [10,25,All] with en-US, and so on.
Matthieu Sarter 8 年之前
父节点
当前提交
67ef1bda66
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -1382,7 +1382,7 @@
 
                 pageList = [];
                 $.each(list, function (i, value) {
-                    pageList.push(value.toUpperCase() === that.options.formatAllRows().toUpperCase() ?
+                    pageList.push((value.toUpperCase() === that.options.formatAllRows().toUpperCase() || value.toUpperCase() === "ALL") ?
                         that.options.formatAllRows() : +value);
                 });
             }