loading time very long
loading time very long
mike
Posts: 2Questions: 0Answers: 0
Hi,
I use a datatable with paging but when I have lots of data (500 or more)
loading time is long enough.
I saw he was using "sAjaxSource", so I put this
[code]
$ ( "# Newstips"). dataTable ((
"sPaginationType": "full_numbers"
"bServerSide": true,
"bProcessing": false,
"sAjaxSource": "get_data.php"
)
[/code]
and in my page I have this:
[code]
<? php
/ * MySQL connection * /
$ gaSql [ 'user'] = "xxxx";
$ gaSql [ 'password'] = "xxxx";
$ gaSql [ 'db'] = "xxxx";
$ gaSql [ 'server'] = "localhost";
$ gaSql [ 'type'] = "mysql";
$ gaSql [ 'link'] = mysql_connect ($ 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 * /
$ slim = "";
if (isset ($ _GET [ 'iDisplayStart']))
(
$ slim = "LIMIT". mysql_real_escape_string ($ _GET [ 'iDisplayStart']). "".
mysql_real_escape_string ($ _GET [ 'iDisplayLength']);
)
echo "slim". $ slim;
/ * Ordering * /
if (isset ($ _GET [ 'iSortCol_0']))
(
$ sordera = "ORDER BY";
for ($ i = 0; $ i
[/code]
but when I'm on the page I have all the data but I did not swap, I think my file get_data.php is not taken into account
Could you tell me what does not work because I have done full tests
thank you
I use a datatable with paging but when I have lots of data (500 or more)
loading time is long enough.
I saw he was using "sAjaxSource", so I put this
[code]
$ ( "# Newstips"). dataTable ((
"sPaginationType": "full_numbers"
"bServerSide": true,
"bProcessing": false,
"sAjaxSource": "get_data.php"
)
[/code]
and in my page I have this:
[code]
<? php
/ * MySQL connection * /
$ gaSql [ 'user'] = "xxxx";
$ gaSql [ 'password'] = "xxxx";
$ gaSql [ 'db'] = "xxxx";
$ gaSql [ 'server'] = "localhost";
$ gaSql [ 'type'] = "mysql";
$ gaSql [ 'link'] = mysql_connect ($ 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 * /
$ slim = "";
if (isset ($ _GET [ 'iDisplayStart']))
(
$ slim = "LIMIT". mysql_real_escape_string ($ _GET [ 'iDisplayStart']). "".
mysql_real_escape_string ($ _GET [ 'iDisplayLength']);
)
echo "slim". $ slim;
/ * Ordering * /
if (isset ($ _GET [ 'iSortCol_0']))
(
$ sordera = "ORDER BY";
for ($ i = 0; $ i
[/code]
but when I'm on the page I have all the data but I did not swap, I think my file get_data.php is not taken into account
Could you tell me what does not work because I have done full tests
thank you
This discussion has been closed.
Replies
[code]
$( "# Newstips").dataTable ( {
"sPaginationType": "full_numbers"
"bServerSide": true,
"bProcessing": false,
"sAjaxSource": "get_data.php"
} )
[/code]
Also worth installing Firebug if you haven't already.
Allan
[code]
"sPaginationType": "full_numbers"
[/code]
and I firebug but none errors in JS
If I not add a comma at end the first line, on the page no show
but if I add, I show datas but not pagination