loading time very long

loading time very long

mikemike Posts: 2Questions: 0Answers: 0
edited March 2010 in TableTools
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

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Your code isn't valid. Are you not getting a JS error from your web-browser for that? Try:

    [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
  • mikemike Posts: 2Questions: 0Answers: 0
    edited March 2010
    I try your code but I add a comma on
    [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
This discussion has been closed.