Вопрос

I'm using jquery tablesorter lib from tablesorter.com. I've a table with multiple columns with thead and tbody. I have column 5 and 6 disabled from sorting. All the other columns sort properly but column 7. I can't seem to make column 7 sort at all. Here's my Plunker example.

http://embed.plnkr.co/BiAvoUxFd5Q9rtz46XOt/preview

Это было полезно?

Решение

The version of tablesorter you are using is v2.0.1, so it's not even the latest version from tablesorter.com.

Also, thank you for enabling the debug code. It appears that "Col 7" (column 6 in the debug) is being set to use the "integer" parser, so when you sort it is sorting, but not using the correct values. It appears that v2.0.5 that is from tablesorter.com has fixed this issue (demo).

$(function () {
    $("#table").tablesorter({
        widthFixed: true,
        headers: {
            4: { sorter : false },
            5: { sorter : false },
            7: { sorter : false },
            8: { sorter : false },
            9: { sorter : false },
            10: { sorter : false },
            11: { sorter : false }
        }
    });
});

Might I also suggest that you try out my fork of tablesorter which has many other improvements and enhancements.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top