2013-08-16 93 views
1

我想使用Tablesorter和Scroller Widget。我似乎无法做到。看起来bootstrap.css会影响固定标题的大小。Tablesorter Scroller引导程序不工作

这是一个example的问题。

$(".tablesorter").tablesorter({ 
widthFixed : true, 
showProcessing: true, 
headerTemplate : '{content} {icon}', 
widgets: [ 'zebra', 'scroller' ], 
widgetOptions : { 
    scroller_height : 300, 
    scroller_barWidth : 17, 
    scroller_jumpToHeader: true, 
    scroller_idPrefix : 's_' 
} 

下面是HTML:

<div class="row"> 
     <div class="span12 hidden-phone"> 
      <table class="tablesorter"> 
<caption>Student Grades</caption> 
<thead> 
    <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th class="filter-false sorter-false">Geometry</th></tr> 
</thead> 
<tfoot> 
    <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr> 
</tfoot> 
<tbody> 
    <tr><td>Student01</td><td>Languages</td><td>male</td><td>80</td><td>70</td><td>75</td><td>80</td></tr> 
    <tr><td>Student02</td><td>Mathematics</td><td>male</td><td>90</td><td>88</td><td>100</td><td>90</td></tr> 
    <tr><td>Student03</td><td>Languages</td><td>female</td><td>85</td><td>95</td><td>80</td><td>85</td></tr> 
    <tr><td>Student04</td><td>Languages</td><td>male</td><td>60</td><td>55</td><td>100</td><td>100</td></tr> 
</tbody> 
</table> 

+0

你的问题是什么? –

回答

0

,如果我们没有bootstrap.css那么它将如here

这里是代码的tablesorter工作该演示缺少theme.bootstrap.css文件和一些选项(主题& uitheme小部件; updated demo

$(".tablesorter").tablesorter({ 
    theme: 'bootstrap', // set bootstrap theme 
    widthFixed: true, 
    showProcessing: true, 
    headerTemplate: '{content} {icon}', 
    widgets: ['zebra', 'uitheme', 'scroller'], // include uitheme widget 
    widgetOptions: { 
     scroller_height: 300, 
     scroller_barWidth: 17, 
     scroller_jumpToHeader: true, 
     scroller_idPrefix: 's_' 
    } 
}); 
+0

这在Chrome中可用,但目前不在FF 23.0.1中。将在更改时更新。 – r0n22

+0

scoller插件中存在一个错误。第206行:应该是$ hdr.width($ tbl.innerWidth())。parent()。width($ tbl.innerWidth());现在它已经修复,系统运行良好! – r0n22

+0

我没有注意到您分享的上述代码的结果有任何不同。这是特定浏览器中的问题吗? – Mottie

0

编辑:在另一方面通过r0n22的变化scroller.js在评论中所做的上述回应,我不工作(火狐29)。

scoller插件中存在一个错误。第206行:应该是 $ hdr.width($ tbl.innerWidth())。parent()。width($ tbl.innerWidth());现在 它是固定的系统工作伟大!