AJAX call not rendering on the screen when page number is greater than 0 #151

trevorbernard opened this Issue Oct 12, 2012 · 5 comments

3 participants


The first page renders but any subsequent pages don't. The AJAX call is correctly returning the same data. I based the code from this page: http://mottie.github.com/tablesorter/docs/example-pager-ajax.html

It also appears to be happening on that page as well.

Warmest regards


Wow, I totally missed that. It looks like the rows are there, just hidden, but I'll look into it. Thanks!


Awesome, thanks!


The culprit appears to be the following line:


I'm not quite sure what the first predicate condition is supposed to accomplish but it seems like j should be initialized at s which would always equal true. In it's current form, all rows not on the first page would be display:none. Thoughts?


I worked around this by changing

j = 0;


j=( typeof(a.ajaxUrl) === 'string' ) ? s : 0;

YMMV, but it seems to be working for me.


LOL that'll work too... I actually wrapped the whole function:

hideRows = function(table, c){
    if (!c.ajaxUrl) {
        var i,
        rows = $('tr:not(.' + table.config.cssChildRow + ')', table.tBodies),
        l = rows.length,
        s = ( c.page * c.size ),
        e =  s + c.size,
        j = 0; // size counter
        for ( i = 0; i < l; i++ ){
            if (!/filtered/.test(rows[i].className)) {
                rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';

I am actually working on updating the headers correctly when information is provided, then I'll push the updates.

@Mottie Mottie closed this in 597ec7d Oct 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment