Browse Source

Add selectItemName option.

zhixin 11 years ago
parent
commit
ff242859ae
2 changed files with 10 additions and 1 deletions
  1. 6 0
      docs/docs.js
  2. 4 1
      src/bootstrap-table.js

+ 6 - 0
docs/docs.js

@@ -114,6 +114,12 @@ $(function () {
                 type: 'Boolean',
                 description: 'Enable the search input.',
                 'default': 'false'
+            },
+            {
+                name: 'selectItemName',
+                type: 'String',
+                description: 'The name of radio or checkbox input.',
+                'default': 'btSelectItem'
             }
         ]
     });

+ 4 - 1
src/bootstrap-table.js

@@ -61,6 +61,7 @@
         pageSize: 10,
         pageList: [10, 25, 50, 100],
         search: false,
+        selectItemName: 'btSelectItem',
 
         onClickRow: function(item) {return false;},
         onSort: function(name, order) {return false;},
@@ -468,7 +469,9 @@
                     type = that.options.columns[j].radio ? 'radio' : type;
 
                     text = ['<td>',
-                        '<input name="btSelectItem" class="checkbox" data-index="' + i + '"' +
+                            '<input class="checkbox"' +
+                            sprintf(' data-index="%s"', i) +
+                            sprintf(' name="%s"', that.options.selectItemName) +
                             sprintf(' type="%s"', type) +
                             sprintf(' checked="%s"', value ? 'checked' : undefined) + ' />',
                         '</td>'].join('');