Skip to content

Commit

Permalink
Increment totalRows and pageSize on row insertion in server mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarazar928Ghost committed May 1, 2024
1 parent 252383b commit a0e54fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,7 @@ class BootstrapTable {

if (this.options.sidePagination === 'server') {
this.options.totalRows -= removed
this.options.pageSize -= removed
this.data = [...this.options.data]
}

Expand All @@ -2619,6 +2620,10 @@ class BootstrapTable {
return
}
this.options.data.splice(params.index, 0, params.row)
if (this.options.sidePagination === 'server') {
this.options.totalRows += 1;

Check failure on line 2624 in src/bootstrap-table.js

View workflow job for this annotation

GitHub Actions / test

Extra semicolon
this.options.pageSize += 1;

Check failure on line 2625 in src/bootstrap-table.js

View workflow job for this annotation

GitHub Actions / test

Extra semicolon
}
this.initSearch()
this.initPagination()
this.initSort()
Expand Down Expand Up @@ -2724,6 +2729,7 @@ class BootstrapTable {

if (this.options.sidePagination === 'server') {
this.options.totalRows -= 1
this.options.pageSize -= 1
this.data = [...this.options.data]
}

Expand Down

0 comments on commit a0e54fc

Please sign in to comment.