Paging... Am I missing something?

Paging... Am I missing something?

robbiesmith79robbiesmith79 Posts: 16Questions: 0Answers: 0
edited September 2010 in General
The pagination says Showing 1 to 10 of 10 entries (filtered from 62 total entries)

... of 10 entries? There's 62 and I don't think I'm filtering anything. I tried to trace the jquery.datatables.js file for about an hour and couldn't find the location where this thing think's it's filtered.

What am I missing to get this pagination working?

Thanks,

Replies

  • robbiesmith79robbiesmith79 Posts: 16Questions: 0Answers: 0
    edited September 2010
    Here's the start of my JSON code. Is this related to the 1.7.2 paging bug reported earlier?

    http://www.georgestreetplayhouse.org/scripts/DataTables/examples/examples_support/server_processing_ordering.php

    [code]{"sEcho": 0, "iTotalRecords": 62, "iTotalDisplayRecords": 62, "sColumns": "view,name,type,date_of_purchase,invoice,amount,email,customer,staff,","aaData": [ ["View","abby schenkman",...[/code]
  • robbiesmith79robbiesmith79 Posts: 16Questions: 0Answers: 0
    SOLVED... grumble grumble

    I wasn't including the "SELECT SQL_CALC_FOUND_ROWS id" part of the original query, which if you look a few lines down in the server_process_ordering.php page:
    [code]
    $sQuery = "
    SELECT COUNT(id)
    FROM orders
    ";
    $rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
    $aResultTotal = mysql_fetch_array($rResultTotal);
    $iTotal = $aResultTotal[0];
    [/code]

    $iTotal never got set properly hence it showed 1 to 10 of 10 (filtered from...) Now having added that SQL_CALC_FOUND_ROWS id as the first parameter back into my query, this has solved my paging problem.

    I spent 5 hours tracing the plugin.js in an attempt to figure out if I was wrong, or the code was wrong.

    I was wrong,

    Robbie
This discussion has been closed.