Browse Source

#448: Cardview support checkbox and radio and fix cardview events do not work bug.

zhixin 11 years ago
parent
commit
08f3e0620a
1 changed files with 3 additions and 7 deletions
  1. 3 7
      src/bootstrap-table.js

+ 3 - 7
src/bootstrap-table.js

@@ -1049,15 +1049,11 @@
                 }
 
                 if (column.checkbox || column.radio) {
-                    //if card view mode bypass
-                    if (that.options.cardView) {
-                        return true;
-                    }
-
                     type = column.checkbox ? 'checkbox' : type;
                     type = column.radio ? 'radio' : type;
 
-                    text = ['<td class="bs-checkbox">',
+                    text = [that.options.cardView ?
+                        '<div class="card-view">' : '<td class="bs-checkbox">',
                         '<input' +
                             sprintf(' data-index="%s"', i) +
                             sprintf(' name="%s"', that.options.selectItemName) +
@@ -1068,7 +1064,7 @@
                             sprintf(' disabled="%s"', !column.checkboxEnabled ||
                                 (value && value.disabled) ? 'disabled' : undefined) +
                             ' />',
-                        '</td>'].join('');
+                        that.options.cardView ? '</div>' : '</td>'].join('');
                 } else {
                     value = typeof value === 'undefined' || value === null ?
                         that.options.undefinedText : value;