Browse Source

Fixed not trigger sort event bug using server-side pagination

zhixin 1 year ago
parent
commit
17502c8512
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bootstrap-table.js

+ 2 - 1
src/bootstrap-table.js

@@ -583,6 +583,8 @@ class BootstrapTable {
   _sort () {
   _sort () {
     if (this.options.sidePagination === 'server' && this.options.serverSort) {
     if (this.options.sidePagination === 'server' && this.options.serverSort) {
       this.options.pageNumber = 1
       this.options.pageNumber = 1
+
+      this.trigger('sort', this.options.sortName, this.options.sortOrder)
       this.initServer(this.options.silentSort)
       this.initServer(this.options.silentSort)
       return
       return
     }
     }
@@ -593,7 +595,6 @@ class BootstrapTable {
     }
     }
 
 
     this.trigger('sort', this.options.sortName, this.options.sortOrder)
     this.trigger('sort', this.options.sortName, this.options.sortOrder)
-
     this.initSort()
     this.initSort()
     this.initBody()
     this.initBody()
   }
   }