2014-07-13 59 views

回答

1

你能否分享一些关于何时需要这些信息的更多细节。

我写了这个答案,假设你想排序后的排序信息。在此示例中,仅被返回所述第一排序列信息,但所有排序列将包含内table.config.sortList变量(demo):

$(function() { 
    $('table') 
    .on('sortEnd', function(){ 
     var currentSort = this.config.sortList, 
      firstColumn = currentSort[0][0], 
      firstColumnDirection = currentSort[0][1] === 0 ? 'Ascending' : 'Descending'; 
     console.log('column = ' + firstColumn, ', direction = ' + firstColumnDirection); 
    }) 
    .tablesorter({ 
     theme: 'blue' 
    }); 
}); 
相关问题