2010-11-16 28 views

回答

1

我結束了使用sortEnd事件和檢查.sorted-AZ和.sorted座的的存在類來確定排序的列。

table.bind("sortEnd", function() { 
    var checkSort = function (query, order) { 
     var column = table.find(query); 

     if (column.length == 1){ 
      // Do stuff 
     } 
    }; 

    checkSort("th.sorted-a-z", "descending"); 
    checkSort("th.sorted-z-a", "ascending"); 
}); 
1

委託只要分配表和捉對th元素click事件:

$('#table').delegate('th', 'click', function(e) { 
    //e.target will point to the header that was clicked 
}); 
3

.tablesorter .header設置自己的點擊事件應該提供一個簡單的方法來獲得列點擊,同時與其它表避免衝突

相關問題