Understanding the data source
Understanding the data source
Hi,
I'm very interested in this plugin as it seems really great for my purposes. However I would like to clarify some things which I wasn't able to find in the documentation.
This may sound like a 'newbie' question, however I would like to ask what data source should I use if I get say 1000 rows? Using DOM to generate all records seems to be quite inefficient to me. Till now I have generated only a certain amount of rows with limiting the sql query. What is the best way to handle this?
Is http://datatables.net/release-datatables/examples/data_sources/ajax.html this what should I use?
I might be missing something, any help will be greatly appreciated.
I'm very interested in this plugin as it seems really great for my purposes. However I would like to clarify some things which I wasn't able to find in the documentation.
This may sound like a 'newbie' question, however I would like to ask what data source should I use if I get say 1000 rows? Using DOM to generate all records seems to be quite inefficient to me. Till now I have generated only a certain amount of rows with limiting the sql query. What is the best way to handle this?
Is http://datatables.net/release-datatables/examples/data_sources/ajax.html this what should I use?
I might be missing something, any help will be greatly appreciated.
This discussion has been closed.
Replies
If you do get a problem with performance, read up on server-side processing:
http://datatables.net/release-datatables/examples/data_sources/server_side.html
Allan
Thanks for the prompt response.
So to clarify it you dont think that generating 1000 table rows on a single html page is too many? I always limited this number so that the load time is quick.
On balance, for me, 1000 records in the DOM is okay, but it really depends upon your use case and target market.
Allan
Thank you again for for response.
I have now implemented the data tables according to my needs. However I'm still little struggling with that thousands of rows being rendered on the page. Never done this before and always considered it as a too "heavy weight" when I could only need a couple of rows. Seems like wasting the bandwith. Can you take a look at an example I just put up at http://enn.9e.cz/cms/test2.php? Its a really large amount of DOM Data, at least to me:).
I'm considering on implementing this in my CMS, so only editors would have access to these tables, which could mean that the bandwith will be ok for this purpose. One more question for now - what would you "generally" say is the limit of generating rows to the DOM ?
Thank you again for your assistance.
I don't understand why you don't simply run tests for as much or as little data as may be required, and review performance accordingly. You are the only person using your configuration of hard- and software; anyone else can only speculate.
Thanks for the response.
As you said, its just an example. I can easily generate much more. But even this seems too much to me.
If I modify the data source so that I will get say 100 rows, I wont be able to sort all of them and more importantly the pagination of DataTable wont work because it wont simply know the rows are there..
See http://datatables.net/faqs#speed .
However, it is basically up to yourself. If you don't want to transmit the full set of rows - use server-side processing that @tangerine mentioned, which will get only the rows needed for the current display.
Allan