表排序器配置标头
有没有办法通过 id 或类而不是列号来配置表排序器标题?
所以不是这样:
headers:
{ 0: { sorter: 'digit' } ,
1: { sorter: false }
}
我想这样做:
'some class or id': { sorter: 'digit' } ,
'some class or id': { sorter: false }
排序也一样
[[0,0],[1,0]] => would be [['some class',0],['some id',0]]
Is there a way to configure tablesorter headers by ids or classes instead of column number?
So instead of this:
headers:
{ 0: { sorter: 'digit' } ,
1: { sorter: false }
}
I'd like to do it like this:
'some class or id': { sorter: 'digit' } ,
'some class or id': { sorter: false }
And the same for sorting
[[0,0],[1,0]] => would be [['some class',0],['some id',0]]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找不到一种方法来做到这一点(如果可以的话,这将是我所需要的完美选择)但这对我有用 - http://tablesorter.com/docs/example-meta-headers.html
请注意,该页面上的演示实际上不起作用,但是当我还包含元数据时插件(jquery.metadata.js - 包含在下载中)并将
class="{sorter: false}"
添加到它有效的标题中。I couldn't find a way to do exactly that (would have been perfect for what I needed if I could) but this worked for me - http://tablesorter.com/docs/example-meta-headers.html
Note that the demo on that page doesn't actually work, but when I also included the MetaData plugin (jquery.metadata.js - included in the download) and added the
class="{sorter: false}"
to the heading it worked.如果您使用以下插件,请检查配置文档。
http://tablesorter.com/docs/
如果您正在使用其他插件,请尝试检查文档。希望有帮助!
If you are below plugin, check the configuration documentation.
http://tablesorter.com/docs/
If you are using some other plugin try checking the documentation. Hope it helps!