Buttons Plug-ins
Buttons Plug-ins
ruella
Posts: 1Questions: 1Answers: 0
Hi, I have install buttons plug-ins for export data. My table is serverSide=true with multi pages how result.
The problem is that export butto, export only data display in one page and not all data...
Can help me anyone?
Thanks.
This discussion has been closed.
Answers
So with server side data, the entire table is not present in the browser. It exists on the server and DT makes AJAX calls to get the data as it needs - pagination, etc. Your 2 purposes ( server-side and export all data) are really the opposite of each other. You may need to wire up a custom button that goes and gets the export data from the server itself in a custom AJAX call.
Yeah, theres like 100 threads on this. You have two options, a good one and a bad one..
-1
to the lengthMenu, which will allow the user to display all the data, then they can export it..#2 is bad because it completely voids the point of using
serverSide
, because if they select the All, it will have to query it, render it, then re-render it for the export, so you may as well just have it do it once on the server side then download itYes - this comes up a lot. I've just written the following which will be published in the FAQs next time I push the site out (probably later today):
Q. How can I export the whole table when using
serverSide
and Buttons.A. Buttons is a client-side process, so it can only export the data available at the client-side. When server-side processing is enabled, the full data set is not held on the client-side, so only the visible data can be exported. You can either: 1. Use a server-side process to create the files to download (recommended) or 2. Disable server-side processing.
Allan
Isnt using
-1
in the length also annoption? As terrible as it may be, lolSomeone said that worked
It is - but it isn't an option I want to advertise since its pointless :-). -1 with server-side processing has only one upside: if you want to introduce latency into your application, its is a good way to do it.
Allan
Ya, i agree, id disable it in the core js if i were you ;-)