ソースを参照

Fix #3452: reset the table data when url loaded error

zhixin 8 年 前
コミット
6ff3b65ff0
1 ファイル変更7 行追加0 行削除
  1. 7 0
      src/bootstrap-table.js

+ 7 - 0
src/bootstrap-table.js

@@ -2079,6 +2079,13 @@
                 if (!silent) that.$tableLoading.hide();
             },
             error: function (res) {
+                var data = [];
+                if (this.options.sidePagination === 'server') {
+                    data = {};
+                    data[this.options.totalField] = 0;
+                    data[this.options.dataField] = [];
+                }
+                that.load(data);
                 that.trigger('load-error', res.status, res);
                 if (!silent) that.$tableLoading.hide();
             }