ソースを参照

Merge pull request #4681 from wenzhixin/fix/3350

Fix sorting while dragging
文翼 6 年 前
コミット
8b6e6fc9d0

+ 7 - 0
src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

@@ -66,6 +66,13 @@ BootstrapTable.prototype.initHeader = function (...args) {
     return
   }
 
+  const oldHandler = $._data( this.$container[0], 'events' )['click'][0].handler
+  this.$container.off('click', '.th-inner').on('click', '.th-inner', e => {
+    if ($('.dragtable-sortable').length > 0) {
+      e.stopImmediatePropagation()
+    }
+  })
+  this.$container.on('click', '.th-inner', oldHandler)
   this.makeRowsReorderable()
 }