ソースを参照

Add "totalField" Option,defalut is "total" (#2301)

kingyang 9 年 前
コミット
c9d6f89544
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/bootstrap-table.js

+ 2 - 1
src/bootstrap-table.js

@@ -297,6 +297,7 @@
         striped: false,
         columns: [[]],
         data: [],
+        totalField: 'total',
         dataField: 'rows',
         method: 'get',
         url: undefined,
@@ -2365,7 +2366,7 @@
 
         // #431: support pagination
         if (this.options.sidePagination === 'server') {
-            this.options.totalRows = data.total;
+            this.options.totalRows = data[this.options.totalField];
             fixedScroll = data.fixedScroll;
             data = data[this.options.dataField];
         } else if (!$.isArray(data)) { // support fixedScroll