Browse Source

Merge pull request #1391 from jorrigala/patch-1

data-formatter is not working with data-checkbox
文翼 10 years ago
parent
commit
b1b2f1b605
1 changed files with 4 additions and 3 deletions
  1. 4 3
      dist/bootstrap-table.js

+ 4 - 3
dist/bootstrap-table.js

@@ -1475,12 +1475,13 @@
                         sprintf(' data-index="%s"', i) +
                         sprintf(' name="%s"', that.options.selectItemName) +
                         sprintf(' type="%s"', type) +
-                        sprintf(' value="%s"', item[that.options.idField]) +
+                        sprintf(' value="%s"', item[that.options.idField]),
+                        column.formatter === undefined ?
                         sprintf(' checked="%s"', value === true ||
-                            (value && value.checked) ? 'checked' : undefined) +
+                           (value && value.checked) ? 'checked' : undefined) +
                         sprintf(' disabled="%s"', !column.checkboxEnabled ||
                             (value && value.disabled) ? 'disabled' : undefined) +
-                        ' />',
+                        ' />': ' />' + value,
                         that.options.cardView ? '</div>' : '</td>'
                     ].join('');