Skip to content

Commit

Permalink
Fix bug delete an item append 2nd pass (wenzhixin#3043)
Browse files Browse the repository at this point in the history
* Fix bug delete an item append 2nd pass 

See the jsfiddle => http://jsfiddle.net/ehen4v87/

* Update bootstrap-table.js
  • Loading branch information
Flounn authored and wenzhixin committed Dec 17, 2017
1 parent 4adb7ce commit bf304e7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bf304e7

Please sign in to comment.