From bf304e753705c214dcdbf3cf87be2d50b9dbab35 Mon Sep 17 00:00:00 2001 From: Flounn Date: Sun, 17 Dec 2017 16:40:01 +0100 Subject: [PATCH] Fix bug delete an item append 2nd pass (#3043) * Fix bug delete an item append 2nd pass See the jsfiddle => http://jsfiddle.net/ehen4v87/ * Update bootstrap-table.js --- src/bootstrap-table.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index af5842fe48..a67015a7ba 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -942,22 +942,15 @@ * @param type: append / prepend */ BootstrapTable.prototype.initData = function (data, type) { - if (type === 'append') { - this.data = this.data.concat(data); - } else if (type === 'prepend') { - this.data = [].concat(data).concat(this.data); - } else { - this.data = data || this.options.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; + this.options.data = data || this.options.data; } + + this.data = this.options.data; if (this.options.sidePagination === 'server') { return;