iDisplayLength is not changing in pipeline
iDisplayLength is not changing in pipeline
raju.softagz
Posts: 6Questions: 0Answers: 0
This is too great tool
but I am facing some problem
I have added http://datatables.net/examples/server_side/pipeline.html to my site
My PHP process file have limit condition like
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = " LIMIT ". php_db_input( $_GET['iDisplayStart'] ).", ".
php_db_input( $_GET['iDisplayLength'] );
}
On defualt is show 0, 500
my total records are 5,230 total entries
But the navigation is showing - "Showing 1 to 100 of 500 entries (filtered from 5,230 total entries)"
when i click on page navigation on last page 5 , it disables my next option.
i think on last page the iDisplayLength is not increasing automatically..
Please help me
but I am facing some problem
I have added http://datatables.net/examples/server_side/pipeline.html to my site
My PHP process file have limit condition like
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = " LIMIT ". php_db_input( $_GET['iDisplayStart'] ).", ".
php_db_input( $_GET['iDisplayLength'] );
}
On defualt is show 0, 500
my total records are 5,230 total entries
But the navigation is showing - "Showing 1 to 100 of 500 entries (filtered from 5,230 total entries)"
when i click on page navigation on last page 5 , it disables my next option.
i think on last page the iDisplayLength is not increasing automatically..
Please help me
This discussion has been closed.
Replies
[code]
var oCache = {
iCacheLower: -1
};
function fnSetKey( aoData, sKey, mValue )
{
for ( var i=0, iLen=aoData.length ; i
Allan
My Ajax request on first time without any filter apply is
http://softagz.example.com/intranet/get_user_data.php?sEcho=1&iColumns=6&sColumns=&iDisplayStart=400&iDisplayLength=500&sNames=%2C%2C%2C%2C%2C&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=true&sSearch_5=&bRegex_5=false&bSearchable_5=false&iSortingCols=1&iSortCol_0=0&sSortDir_0=desc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&bSortable_5=false
I think iDisplayLength=500 , i have put iDisplayLength=500000 to my js code but i have not reflected..
on last page, (Page 5). it disables the next button , but when i refresh whole page it increase some more button.
so the
iTotalRecords = 5230
iTotalDisplayRecords = 500
So iTotalRecords and iTotalDisplayRecords will never same
iTotalRecords - Total records, before filtering (i.e. the total number of records in the database)
iTotalDisplayRecords - Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)
If DataTables wanted to know how many rows you are returned it would just do an Array.length on the return (which it does in fact). So it needs to know how many rows are not returned (i.e. not on the current page).
Allan
Sorry for asking one more time, but i am not understanding the situation.
I have used queries same like your example..
i want to send to process page.
Because first time, i am getting iDisplayLength=500 so the records query have limeit 0, 500 and only showing the 500 records. The total number of records doesn't have limit , so it gives the total records.
I want to change the records on first page or on default page (iDisplayLength=) or change on last page (Page 5 )
what i do for now ?
If you have 5230 rows in your table, then on the initial draw you want:
iTotalRecords = 5230
iTotalDisplayRecords = 5230
i.e. count the number of rows before the filter gives you iTotalDisplayRecords. And then count hte number of rows after the filter gives you iTotalRecords. If no filter is applied, then they are equal, and the same as the number of rows in your database table.
Allan
Thanks for help and for your valuable time
I have got my mistake .. in the process file.
I havent add the SQL_CALC_FOUND_ROWS , so i am not getting proper result
bye