ソースを参照

update property name class to className and support IE brower.

zhixin 12 年 前
コミット
580639c473
2 ファイル変更10 行追加10 行削除
  1. 2 2
      bootstrap-table.js
  2. 8 8
      index.html

+ 2 - 2
bootstrap-table.js

@@ -18,7 +18,7 @@
 		constructor: Table,
 		constructor: Table,
 		
 		
 		init: function() {
 		init: function() {
-			this.$el.addClass(this.options.class);
+			this.$el.addClass(this.options.className);
 			this.$header = $('<thead></thead>');
 			this.$header = $('<thead></thead>');
 			this.$el.append(this.$header);
 			this.$el.append(this.$header);
 			this.$body = $('<tbody></tbody>');
 			this.$body = $('<tbody></tbody>');
@@ -119,7 +119,7 @@
 	};
 	};
 	
 	
 	$.fn.bootstrapTable.defaults = {
 	$.fn.bootstrapTable.defaults = {
-		class: 'table table-bordered table-hover',
+		className: 'table table-bordered table-hover',
 		columns: [],
 		columns: [],
 		data: [],
 		data: [],
 		onClickRow: function() {return false;}
 		onClickRow: function() {return false;}

+ 8 - 8
index.html

@@ -33,9 +33,9 @@
             {field: 'default', title: 'Default', align: 'right', width: 180}
             {field: 'default', title: 'Default', align: 'right', width: 180}
           ],
           ],
           data: [
           data: [
-            {name: 'class', type: 'String', description: 'The table class', default: 'table table-bordered table-hover'},
-            {name: 'columns', type: 'Array', description: 'The table columns config object, see column properties for more details.', default: '[]'},
-            {name: 'data', type: 'Array', description: 'The data to be loaded.', default: '[]'}
+            {name: 'className', type: 'String', description: 'The table class name', 'default': 'table table-bordered table-hover'},
+            {name: 'columns', type: 'Array', description: 'The table columns config object, see column properties for more details.', 'default': '[]'},
+            {name: 'data', type: 'Array', description: 'The data to be loaded.', 'default': '[]'}
           ]
           ]
         });
         });
         $('#column').bootstrapTable({
         $('#column').bootstrapTable({
@@ -46,11 +46,11 @@
             {field: 'default', title: 'Default', align: 'right', width: 180}
             {field: 'default', title: 'Default', align: 'right', width: 180}
           ],
           ],
           data: [
           data: [
-            {name: 'field', type: 'String', description: 'The column field name.', default: 'undefined'},
-            {name: 'title', type: 'String', description: 'The column title text.', default: 'undefined'},
-            {name: 'align', type: 'String', description: 'Indicate how to align the column data. "left", "right", "center" can be used.', default: 'undefined'},
-            {name: 'width', type: 'Number', description: 'The width of column. If not defined, the width will auto expand to fit its contents.', default: 'undefined'},
-            {name: 'formatter', type: 'Function', description: 'The cell formatter function, take two parameters: <br />value: the field value. <br />row: the row record data.', default: 'undefined'}
+            {name: 'field', type: 'String', description: 'The column field name.', 'default': 'undefined'},
+            {name: 'title', type: 'String', description: 'The column title text.', 'default': 'undefined'},
+            {name: 'align', type: 'String', description: 'Indicate how to align the column data. "left", "right", "center" can be used.', 'default': 'undefined'},
+            {name: 'width', type: 'Number', description: 'The width of column. If not defined, the width will auto expand to fit its contents.', 'default': 'undefined'},
+            {name: 'formatter', type: 'Function', description: 'The cell formatter function, take two parameters: <br />value: the field value. <br />row: the row record data.', 'default': 'undefined'}
           ]
           ]
         });
         });
         $('#event').bootstrapTable({
         $('#event').bootstrapTable({