Paging... Am I missing something?
Paging... Am I missing something?
robbiesmith79
Posts: 16Questions: 0Answers: 0
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,
... 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,
This discussion has been closed.
Replies
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]
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