Export to JSON Button?
Export to JSON Button?
guillochon
Posts: 56Questions: 19Answers: 0
Hi all, very simple question: Has anyone written an export to JSON custom button for DataTables before? Would be great to have this in addition to export to CSV, etc. Because of JSON hierarchical nature it wasn't clear to me if it was possible to use the existing custom button functionality to export to JSON.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There currently isn't - but that's an extremely good idea!
With Buttons 1.2 the file save methods will be exposed via the API (currently they aren't externally accessible), which will make this an absolute breeze with the DataTables API.
Hoping to have Buttons 1.2 out next week. I'll include an example that demonstrates this.
Allan
@allan That's fantastic! Looking forward to the new Buttons release.
Committed the change to expose FileSaver.js and a JSON file export example - thanks for the suggestion!
Buttons 1.2 was delayed a bit, but is coming :-)
Regards,
Allan