Browse Source

Merge pull request #2075 from thornomad/feature/fix-2074-onClickCell

fix(js): return field from visible cells
wenzhixin 9 years ago
parent
commit
9d50433cbc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bootstrap-table.js

+ 2 - 1
src/bootstrap-table.js

@@ -1775,7 +1775,8 @@
                 $tr = $td.parent(),
                 item = that.data[$tr.data('index')],
                 index = $td[0].cellIndex,
-                field = that.header.fields[that.options.detailView && !that.options.cardView ? index - 1 : index],
+                fields = that.getVisibleFields(),
+                field = fields[that.options.detailView && !that.options.cardView ? index - 1 : index],
                 column = that.columns[getFieldIndex(that.columns, field)],
                 value = getItemField(item, field, that.options.escape);