Dennis Hernández 10 年之前
父节点
当前提交
1bbd9874f2
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/bootstrap-table.js

+ 9 - 1
src/bootstrap-table.js

@@ -615,7 +615,15 @@
         } else {
             this.data = data || this.options.data;
         }
-        this.options.data = this.data;
+
+        // Fix #839 Records deleted when adding new row on filtered table
+        if (type === 'append') {
+            this.options.data = this.options.data.concat(data);
+        } else if (type === 'prepend') {
+            this.options.data = [].concat(data).concat(this.options.data);
+        } else {
+            this.options.data = this.data;
+        }
 
         if (this.options.sidePagination === 'server') {
             return;