Write all rows to .txt but dont use all for init
Write all rows to .txt but dont use all for init
hey all,
i write my db results to a txt file using json_encode and output it via sAjaxSource, which works fine. However on our project the data loaded is to heavy, although only 900 rows. Properbly to other jquery stuff, but we cant remove any of them
Well to the questions. When i let sajaxsource load the data
[code] "sAjaxSource": "dataset.txt",
[/code]
it loads all of it at once from the txt file. Does it support a function to have it work like this way of some sort?
- let sajaxsource only read the first 10 of these total 900 records from the txt file to speed up the initialization in our case. Then when searching or using pagination, it reads the next 10 etc.
Thank you
i write my db results to a txt file using json_encode and output it via sAjaxSource, which works fine. However on our project the data loaded is to heavy, although only 900 rows. Properbly to other jquery stuff, but we cant remove any of them
Well to the questions. When i let sajaxsource load the data
[code] "sAjaxSource": "dataset.txt",
[/code]
it loads all of it at once from the txt file. Does it support a function to have it work like this way of some sort?
- let sajaxsource only read the first 10 of these total 900 records from the txt file to speed up the initialization in our case. Then when searching or using pagination, it reads the next 10 etc.
Thank you
This discussion has been closed.
Replies
There is indeed a way to accomplish your END goal: that is to use server-side processing (http://datatables.net/usage/server-side); however, the two things are exclusive. To do it the "right" way, you have to use server-side code to generate and return your data set. You cannot just use a flat data file.
This is a limitation of how AJAX works, not DataTables itself.
Allan