Skip to content

Multi-columns-sorting works only after the first manual sorting #1585

@automatix

Description

@automatix

Hello!

Following scenario: I have a table with columns A, B, C, and D. All the columns excepting the C are sortable. The Default sorting is: D [DESC], A [ASC] . Working fine. But now I want to add a further column (D) to the sorting (SCHIFT + click on the column's head).

Expected behavior: The primary and the secondary sorting remain as they are. A tertiary sorting (by D) is added. The table is sorted by three columns.

Observed behavior: The primary and the secondary sorting get reset. The table is now sorted only by the column D.

My code:

$(function () {
    $("#content .table").tablesorter({
        textExtraction: function (node, table, cellIndex) {
            n = $(node);
            return n.attr('data-normalized') || n.text();
        },
        headers: {
            2: {
                sorter: false
            }
        },
        cancelSelection: true,
        sortList: [
            [3,1], [0,0]
        ],
        widgets : ['columns'],
        widgetOptions : {
            columns : ['primary', 'secondary', 'tertiary'],
            columns_thead : true,
            columns_tfoot : true
        }
    });
});

For me it seems to be a bug, but maybe it's just about configuration?..

Best regards,
Ilya

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions