How to export all rows from Datatables using Ajax?

前端 未结 12 1221
广开言路
广开言路 2020-11-29 23:38

I am using new feature in Datatables: \"HTML5 export buttons\". I am loading data with Ajax.

https://datatables.net/extensions/buttons/examples/html5/simple.html

12条回答
  •  孤街浪徒
    2020-11-29 23:52

    I'm using Datatables Version: 1.10.15, and got @kevenpo's answer to work. I had to modify it a bit to handle our server-side parameters, but that was the only stumbling block. I changed his line: data.length = 2147483647; to data.params[2]= -1; because we stored our server-side parameters in a params sub-array. I have not tested it yet with a very large dataset to see what the performance is, but this is a very clever solution.

提交回复
热议问题