Browse Source

Fix #97: add 'sortable' class to header cells instead of 'cursor: pointer'.

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

+ 4 - 0
src/bootstrap-table.css

@@ -54,6 +54,10 @@
     white-space: nowrap;
     white-space: nowrap;
 }
 }
 
 
+.fixed-table-container thead th .sortable {
+    cursor: pointer;
+}
+
 .fixed-table-container tbody td {
 .fixed-table-container tbody td {
     border-left: 1px solid #dddddd;
     border-left: 1px solid #dddddd;
 }
 }

+ 2 - 2
src/bootstrap-table.js

@@ -308,14 +308,14 @@
                     sprintf('vertical-align: %s; ', column.valign);
                     sprintf('vertical-align: %s; ', column.valign);
             }
             }
             style += sprintf('width: %spx; ', column.checkbox || column.radio ? 36 : column.width);
             style += sprintf('width: %spx; ', column.checkbox || column.radio ? 36 : column.width);
-            style += that.options.sortable && column.sortable ? 'cursor: pointer; ' : '';
 
 
             html.push('<th',
             html.push('<th',
                 column.checkbox || column.radio ? ' class="bs-checkbox"' :
                 column.checkbox || column.radio ? ' class="bs-checkbox"' :
                 class_,
                 class_,
                 sprintf(' style="%s"', style),
                 sprintf(' style="%s"', style),
                 '>');
                 '>');
-            html.push('<div class="th-inner">');
+            html.push(sprintf('<div class="th-inner %s">', that.options.sortable && column.sortable ?
+                'sortable' : ''));
 
 
             text = column.title;
             text = column.title;
             if (that.options.sortName === column.field && that.options.sortable && column.sortable) {
             if (that.options.sortName === column.field && that.options.sortable && column.sortable) {