Skip to content

Commit

Permalink
fix(js): fix wenzhixin#1959, sort column shows hidden rows in `server…
Browse files Browse the repository at this point in the history
…` side pagination
  • Loading branch information
wenzhixin committed Jan 1, 2019
1 parent 2f311a9 commit ed0d259
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
ChangeLog
---------

### 1.13.2

- fix(js): fix #1959, sort column shows hidden rows in `server` side pagination

### 1.13.1

- feat(js): add `theadClasses` option to supoort bootstrap v4
Expand Down
13 changes: 11 additions & 2 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@
isIEBrowser () {
return navigator.userAgent.includes('MSIE ') ||
/Trident.*rv:11\./.test(navigator.userAgent)
},

findIndex (items, item) {
for (const [i, it] of items.entries()) {
if (JSON.stringify(it) === JSON.stringify(item)) {
return i
}
}
return -1
}
}

Expand Down Expand Up @@ -1639,7 +1648,7 @@
let attributes = {}
const htmlAttributes = []

if (this.hiddenRows.includes(item)) {
if (Utils.findIndex(this.hiddenRows, item) > -1) {
return
}

Expand Down Expand Up @@ -2646,7 +2655,7 @@
return
}

const index = this.hiddenRows.indexOf(row)
const index = Utils.findIndex(this.hiddenRows, row)

if (!visible && index === -1) {
this.hiddenRows.push(row)
Expand Down

0 comments on commit ed0d259

Please sign in to comment.