Skip to content

First row not sorted when no header #43

@cyrille-gachot

Description

@cyrille-gachot

Hi,

I'm using your plugin to sort entries from the todo plugin list.

Here is an example of the text I have

<sortable 1 1=alpha sumrow=0>
~~TODOLIST checkbox:no header:none~~
</sortable>

The problem I see is that when there is no header, the first line of the table is never sorted.

I looked at the code, and tried to change the following lines

        var havetHead = table.tHead;
        var sindex = 1;
        if ( havetHead ) {
            sindex = 0;
        }

to

        var havetHead = table.tHead;
        var sindex = 0;
        if ( havetHead ) {
            sindex = 1;
        }

So i basically switched the values 0 and 1 for the start index. It fixed the bug for me, but I'm not really sure of the global impact this might have, which is why I've not pushed an PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions