Skip to content

Pager AJAX server-side ordering/filtering - paging (between pages) reorders all columns #1218

@pdtdev

Description

@pdtdev

It appears the 'pager' row/column is now set as a header column?
Therefore on each subsequent 'next/prev page' the order is changed.

Version: tablesorter-2.26.1

image

After next page:

image

Code (HTML and CSS) is the same as Pager plugin - AJAX example:
http://mottie.github.io/tablesorter/docs/example-pager-ajax.html

What am I doing wrong and how can this be fixed?

$("#tblpasskeys")
            .tablesorter({
            theme: 'default',
            widthFixed: true,
            sortLocaleCompare: true, // needed for accented characters in the data
            sortList: sorting,
            widgets: ['zebra', 'filter']
        })
        .tablesorterPager({
            container: $(".pager"),
            ajaxUrl: 'mypasswords_tblsort.php?page={page}&size={size}&{sortList:col}&{filterList:fcol}',
            ajaxError: null,
            ajaxObject: {
                dataType: 'json'
            },
            ajaxProcessing: function(data){
                console.log(data.debug);
                var total, rows, headers;
                total   = data.total_rows;
                headers = data.headers;
                rows    = data.rows;
                return [ total, rows, headers ];
            },
            processAjaxOnInit: true,
            output: '{startRow} to {endRow} ({totalRows})',
            updateArrows: true,
            page: 0,
            size: 10,
            savePages: true,
            pageReset: 0,
            // css class names of pager arrows
            cssNext        : '.next',  // next page arrow
            cssPrev        : '.prev',  // previous page arrow
            cssFirst       : '.first', // go to first page arrow
            cssLast        : '.last',  // go to last page arrow
            cssGoto        : '.gotoPage', // page select dropdown - select dropdown that set the "page" option

            cssPageDisplay : '.pagedisplay', // location of where the "output" is displayed
            cssPageSize    : '.pagesize', // page size selector - select dropdown that sets the "size" option

            // class added to arrows when at the extremes; see the "updateArrows" option
            // (i.e. prev/first arrows are "disabled" when on the first page)
            cssDisabled    : 'disabled', // Note there is no period "." in front of this class name
            cssErrorRow    : 'tablesorter-errorRow' // error information row
        });

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions