初始列排序功能未按预期工作

Initial column sort function not working as expected

我试图在不单击任何内容的情况下对页面加载时的第 5 列进行排序。我可以通过单击 headers 对 table 进行排序,但添加此选项对我不起作用。我有 v2.23.2.

我要排序的列有数字,我希望最大的数字排在最前面,所以降序排列。

$("#table").tablesorter({
    sortInitialOrder: "desc",
    sortList: [4,0]
}); 

现在,它在页面加载时按提升排序,但这是默认设置,我不知道为什么它不起作用。

提前致谢莫蒂:$

sortList: [4,1]

0 的排序值指定升序。你想要 1 降序。

An array of instructions for per-column sorting and direction in the format: [[columnIndex, sortDirection], ... ] where columnIndex is a zero-based index for your columns left-to-right and sortDirection is 0 for Ascending and 1 for Descending. A valid argument that sorts ascending first by column 1 and then column 2 looks like: [[0,0],[1,0]]

http://mottie.github.io/tablesorter/docs/#api