why i got (filtered from X total entries) in the footer
why i got (filtered from X total entries) in the footer
espresso74
Posts: 11Questions: 0Answers: 0
hey guys,
Just implemented datatable plug in, and made it working on my Asp.net. It is brilliant tool to use.
however, i wonder why i got '(filtered from 12 total entries) ' in the footer part(see the below), what does 'filtered' stand for?. and the Next, Previous Button does not work at all. any ideas or which part i have done is wrong?
how can i get ride of this unnecessary incorrect and annoying footer?
--Footer (first page)---------------
Showing 1 to 10 of 10 entries
(filtered from 12 total entries)
thanks
dave
Just implemented datatable plug in, and made it working on my Asp.net. It is brilliant tool to use.
however, i wonder why i got '(filtered from 12 total entries) ' in the footer part(see the below), what does 'filtered' stand for?. and the Next, Previous Button does not work at all. any ideas or which part i have done is wrong?
how can i get ride of this unnecessary incorrect and annoying footer?
--Footer (first page)---------------
Showing 1 to 10 of 10 entries
(filtered from 12 total entries)
thanks
dave
This discussion has been closed.
Replies
any idea with that? :-)
thanks
dave
"Filtered" means that there is a search parameter being used - or possibly more likely here iTotalRecords and iTotalDisplayRecords aren't being returned correctly from the server: http://datatables.net/usage/server-side . If there is no filter then they should both be the same. http://datatables.net/examples/data_sources/server_side.html
Regards,
Allan
I too have the 'filtered' issue when there should not be filter applied.
Executing the php file alone, I see this at the beginning of the printed output:
[code]
{"sEcho": 0, "iTotalRecords": 1987, "iTotalDisplayRecords": 1987, "aaData": [
[/code]
So, unless I must check these values somewhere else in the code, they seems to be right, but in my table I have
Showing 1 to 10 of 10 entries (filtered from 1987 total entries)
And of course, Next button is disabled.
Unfortunately I cannot show this online.
Here is a bit of my code. Hmm I must bring your attention to one particular thing:
My query uses more tables and joins on them and more important, I need to use my own WHERE clause, so I saw that the code how I copied from the example has a problem, since your WHERE clause (that is 'activated when there's a search (and / or maybe a filter too) contains 'WHERE' but of course I already have it in my query, so I simply modified the code.
The code in next post, because of characters limit
Have you any idea?
Thanks in advance, Paolo
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
die( 'Could not open connection to server' );
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
die( 'Could not select database '. $gaSql['db'] );
/* Paging */
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) )
{
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] );
}
/* Ordering */
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i
Inside the js file, into function _fnAjaxUpdateDraw, I put an alert:
[code]alert(json.iTotalRecords + " " + json.iTotalDisplayRecords);[/code]
and yes, these values are different: 1987 and 10
Did you refer to these values?
If so, any hint on what to do?
In the first sQuery, I didn't saw that there was SQL_CALC_FOUND_ROWS before the id... so I didn't used it.
Just using it, now it works (quite).
It hang up on processing around record #50, so there must be something that 'break' the js in one or more of my records.
Next step I'll try to understand what may be.
I had stupid problems with columns names, sorted out thanks to firebug and grabbing the url created and launching that url and seeing which error it printed out.
But I found a thing in your example code that didn't worked for me.
addslashes applied to fields values retrieved from the db and used to populate the table wasn't enough for my records. I had to use htmlentities instead.
Now (hmm next time) it's time to play with jedit.