我想重新加載表格數據(行/ TRs)當用戶點擊一個鏈接,我可以添加更多/附加?數據,但我似乎無法刪除舊的表格數據插入新的表格數據之前。 (BTW:在updatetable.php包含了所有的(TR的)那個表)Tablesort使用Ajax重新點擊表格數據?
這裏是我想要做的事:
$(function() {
$("#append").click(function() {
var test;
$.get('updatetable.php', function(data) {
test = data;
$("#tablesorter-demo").remove();
$("#tablesorter-demo").append(test);
$("#tablesorter-demo").trigger.update(); // <--- I think that error is here, I tried to take out the trigger. but it still doesn't work ?
alert(test);
//return false;
});
});
在href代碼:<a id="append" href="#">Refresh Page</a>
您不知道如何將斑馬條過濾器添加到它並保持排序順序,因此每次數據重新加載時都不會更改訪問者的排序順序,以便它們不必點擊再次向上/向下箭頭。謝謝你的答案。 – compcobalt
我可能需要更多的上下文。如果你創建一個jsbin,我可以看看。 –
在這裏你去http://jsbin.com/uxafik/2/edit – compcobalt