Browse Source

Fix #53: use html function instead of text in header th.

zhixin 11 years ago
parent
commit
19cde0d068
2 changed files with 9 additions and 3 deletions
  1. 8 2
      docs/examples.html
  2. 1 1
      src/bootstrap-table.js

+ 8 - 2
docs/examples.html

@@ -189,8 +189,14 @@
                         <thead>
                         <tr>
                             <th data-field="id" class="col-md-2">Item ID</th>
-                            <th data-field="name" class="col-md-6">Item Name</th>
-                            <th data-field="price" class="col-md-4">Item Price</th>
+                            <th data-field="name" class="col-md-6">
+                                <i class="glyphicon glyphicon-star"></i>
+                                Item Name
+                            </th>
+                            <th data-field="price" class="col-md-4">
+                                <i class="glyphicon glyphicon-heart"></i>
+                                Item Price
+                            </th>
                         </tr>
                         </thead>
                     </table>

+ 1 - 1
src/bootstrap-table.js

@@ -197,7 +197,7 @@
         }
         this.$header.find('th').each(function() {
             var column = $.extend({}, {
-                    title: $(this).text(),
+                    title: $(this).html(),
                     class: $(this).attr('class')
                 }, $(this).data());