如何为JQuery tablesorter插件的filter小部件创建工具提示?

可能相关的问题: jquery tablesorter添加标题/工具提示以显示升序/降序

下面是我试过的HTML:

Column1 Column2
12
34

和JS:

 $('#table1').tablesorter({ theme : 'ice', cssInfoBlock : 'tablesorter-no-sort', widgets: ['zebra', 'stickyHeaders', 'filter'] }); 

标题部分有效。 我没有得到的是filter文本框上的鼠标hover文本。 我不想手动拦截这些事件。

最好使用表头上的data-placeholder属性向filter添加占位符( 演示 )

 AlphaNumeric 

但如果你真的想要一个工具提示出现,那么试试这个代码( 演示 ):

HTML

 AlphaNumeric 

脚本

 $('table') .on('filterInit', function() { var c = this.config; c.$headers.each(function(i){ c.$filters.eq(i).attr( 'title', $(this).attr('data-filter-title') ); }); }) .tablesorter({ theme: 'blue', widgets: ['zebra', 'filter'] });