jQuery setInterval表排序器
如何使用plugin Tablesorter对数据进行排序?我每n毫秒用新数据更新一次表 我的代码:jQuery setInterval表排序器,jquery,setinterval,tablesorter,Jquery,Setinterval,Tablesorter,如何使用plugin Tablesorter对数据进行排序?我每n毫秒用新数据更新一次表 我的代码: $(document).ready(function() { setInterval(foo, 10000); foo(); function foo () {$('#tda').load('# #tt');} $("#tt").tablesorter({ widgets: ["zebra"], sortList:[[2,0]] }); }); 我的页面结
$(document).ready(function() {
setInterval(foo, 10000);
foo();
function foo () {$('#tda').load('# #tt');}
$("#tt").tablesorter({
widgets: ["zebra"],
sortList:[[2,0]]
});
});
我的页面结构是:
<div id="tda">
<table id="tt">
<thead>
</thead>
<tbody>updated data...<tbody>
</table>
</div>
但此数据未排序。应在以下范围内调用Tablesorter:
作为一个提示,也是它现在不起作用的一个原因,您似乎拼错了thead,并且有错误,因为文档中甚至有一个例子。如何对这些自动更新数据进行排序?简单表排序器正在工作[代码:$document.readyfunction{$tt.tablesorter{sortList:[[2,0]]};]或简单自动更新表页也在工作[代码:$document.readyfunction{setIntervalfoo,10000;foo;function foo{$'tda'。加载'tt';};]但它不能一起工作。谢谢!!!它起作用了$函数{setIntervalfoo,10000;foo;函数foo{$'tda'。加载tt,函数{$tt.tablesorter{widgets:[zebra],排序列表:[[2,0]]};};};
$(function() {
setInterval(foo, 10000);
foo();
function foo () {
$('#tda').load("mysite.php", function() {
$("#tt").tablesorter({
widgets: ["zebra"],
sortList:[[2,0]]
});
});
});