设置数字列tablesorter jquery的初始排序顺序

时间:2012-02-13 15:40:34

标签: jquery sorting gridview tablesorter

我想在第一次点击时按降序排列网格中的数字列。?谁能帮我这个?

1 个答案:

答案 0 :(得分:0)

Ven的,

使用" sortlist"选项表示您要按DESCENDING顺序(1)排序,而不是ASCENDING(0)。

文档说:

" sortlist中" - 格式为每列排序和方向的指令数组:[[columnIndex,sortDirection],...]其中columnIndex是从左到右的列的从零开始的索引,而sortDirection对于Ascending是0 1为降序。首先按列1和列2排序的有效参数如下所示:[[0,0],[1,0]]。

e.g。

$(document).ready(function() {
// call the tablesorter plugin
    $("table").tablesorter({
        // sort on the first column and third column, order descending (1)
        sortList: [[0,1],[2,1]]
    });
});

问候尼尔

相关问题