Browse Source

Check if the td is the detail view column before getting more data (#6158)

Dustin Utecht 3 years ago
parent
commit
8b6f15ae07
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/bootstrap-table.js

+ 5 - 4
src/bootstrap-table.js

@@ -1786,6 +1786,11 @@ class BootstrapTable {
     // click to select by column
     this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', e => {
       const $td = $(e.currentTarget)
+
+      if ($td.find('.detail-icon').length) {
+        return
+      }
+
       const $tr = $td.parent()
       const $cardViewArr = $(e.target).parents('.card-views').children()
       const $cardViewTarget = $(e.target).parents('.card-view')
@@ -1797,10 +1802,6 @@ class BootstrapTable {
       const column = this.columns[this.fieldsColumnsIndex[field]]
       const value = Utils.getItemField(item, field, this.options.escape, column.escape)
 
-      if ($td.find('.detail-icon').length) {
-        return
-      }
-
       this.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td)
       this.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field)