Loading too high...
Loading too high...
lifedaniel
Posts: 68Questions: 4Answers: 0
Hello, when my datables is working with 100 rows (in the sql table) it works fine, but when it works with a 1000+ rows database... it's so slowwwwww. Like 5 seconds to load the table. I think the table load EVERY rows in once. It is possible to fix this ?
This discussion has been closed.
Replies
I am having the same problem as I have moved to IE11. IE 10 has no problem. Have restricted query to 1000 rows but still takes a lot longer than in IE10. I think the problem may be with the latest updates to IE11.
Well I'm using google chrome.. :/
Heh - does that constitute a suggestion that you should upgrade Chrome to IE11? ;-)
@lifedaniel - are you Ajax loading the data and have you enabled deferred rendering? See the FAQs.
Allan
How can I use deferred rendering?
Well I can't move from Chrome to IE.. too difficult :-P
Thank you
Said Nothing ! I found it thank you very much Allan!
Well I've added
"ajax": "php/table.datatabletest.php",
"deferRender": true,
in my javascript.
Still take ages at the first loading. :/
up
Can you link to the page so I can take a look please.
Allan
I work with wamp so kinda hard for me to give a link...
I'd suggest using the built in profiler in Chrome in that case to determine what is taking the time. I can't really helot o much without a link though.
Allan
Thank you, here is the link
http://votreserveur.com/test/mods/mod_clients/
I hope you can help me with that
up to not lose the post
Thanks for the link - seems to load very quickly in Chrome for me. By far the biggest time delay is the download of the data which takes 0.5s. The table is rendered a fiction of a second after that.
Allan
Thank you for your answer, the problem is I have only 3k rows (empty ones), but my real table got like 30k rows. 0.5 sec to load 10 rows per 10 rows is very high.. I don't know if you understand me
I would suggest using server-side processing in that case, as per the FAQ I linked to before.
See also the manual's data gather page.
Allan
when I use server side, look what happen : http://votreserveur.com/test/mods/mod_clients/
In which case you haven't implemented server-side processing, as documented in the manual. It looks like the entire data set is being returned.
Allan
got "serverSide": true,
"draw" : 1,
"recordsFiltered": 10,
"ajax": "php/table.datatabletest.php",
as parameters
The link to the manual page shows the simplest serverside initialisation like so:
$('#example').DataTable( {
serverSide: true,
ajax: '/data-source'
} );
Start simple and work up.
/data-source correspond to what? Cause I use "ajax": "php/table.datatabletest.php" atm
"data-source" means your data source.
maybe, but I'ts a file? Directory? It's what? I use ajax so : "ajax": "php/table.datatabletest.php" that replace the datasource.
Still not working btw it load the 3k rows in the same file
You are retrieving the data so your "data source" must be correct.
However, the example I posted does not include "draw" or "recordsFiltered". Why are you not using the example exactly?
Server-side processing is not simply a case of adding
serverSide: true
to the initialisation. You need to have a script that will actually perform the processing.That makes that the script you are ajax loading data from (
table.datatablestest.php
on your page) must implement the server-side processing protocol that is described int he manual, and that I have linked to before: http://datatables.net/manual/server-side .There is an example server-side processing PHP script included in the DataTables package and Editor supports it out of the box.
Allan
I have exactly the same code as the example.. but nothing working for mine it loads all the data of the database in the same window
Well it seems I got an errror when I add :
"type": "POST"
here is the error : DataTables warning : table id=datatabletest - Unknown field : index 0
What does it means? And why can't I add type post?
Not sure - would need to be able to see it. It is still going GET for me.
It is defined int he tech note that error links to: http://datatables.net/manual/tech-notes/4
Allan
Javascript :
PHP :
here you have my code
Thanks. However, the example you linked to is still using GET. Can you update it to use POST so I can see why POST is not working.
Allan