我似乎无法让Mottie的Tablesorter "emptyTo“工作,排序是有效的,但是空单元格排序到我不想要的顶部。我不想做什么特别的事情,我只是对普通的文本进行排序,碰巧有一些空的单元格,我更愿意把它们排序到底部。
我尝试使用"emptyTo“表tried属性from:http://mottie.github.io/tablesorter/docs/example-option-sort-empty.html,但空空格仍按顶部排序。
这些脚本包括:
我正在使用coffeescript:
tableOptions =
emptyTo: 'bottom', //<---- This is the property that should work but isn't :(
showProcessing: true,
widthFixed: true,
widgets: ['zebra', 'stickyHeaders'],
widgetOptions:
stickyHeaders: '',
stickyHeaders_offset: 0,
stickyHeaders_cloneId: '-sticky',
stickyHeaders_addResizeEvent: true,
stickyHeaders_includeCaption: true,
stickyHeaders_zIndex: 2,
stickyHeaders_attachTo: null,
stickyHeaders_filteredToTop: true
stickyHeaders_attachTo: '.scroll'然后..。
$ ->
$('.tablesorter').tablesorter(tableOptions)我的表结构是标准的表器结构:
<table class="tablesorter">
<thead>
<tr><th></th></tr>
</thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>我在这个应用程序中也使用了引导程序,所以我不确定这是否会影响它.如果我遗漏了什么就告诉我。
发布于 2015-01-08 15:23:21
配置是正确的,它有一些冗余设置(也就是默认设置),但最好是安全的,而不是对不起。第2行上的注释不是有效的CoffeeScript语法,但这是为了在堆栈溢出上显示。
由于您已经提到该表是使用javascript (或CoffeeScript )生成的,所以生成数据和使用表order的顺序很重要:
如果使用工作流工具,比如咕噜、吞咽等,并且脚本被编译成一个脚本,那么尊重这个顺序也是很重要的。列出的两个工具都有一种指定包含脚本顺序的方法。
https://stackoverflow.com/questions/27830567
复制相似问题