How can I set a footer property in JSON export of DataTable?
How can I set a footer property in JSON export of DataTable?
gopi.jtech@gmail.com
Posts: 9Questions: 3Answers: 0
There is a footer property in datatable which export the footer data
{
extend: 'csv',
footer: true,
exportOptions: {
columns: ':visible'
}
},
footer : true, property allows to export footer data to csv file.
How can I set this same property in below code
{
text: 'JSON',
action: function ( e, dt, button, config ) {
var data = dt.buttons.exportData();
$.fn.dataTable.fileSave(
new Blob( [ JSON.stringify( data ) ] ),
'Export.json'
);
}
}
Is this possible ? Please help me any solution. Thanks in advance.
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
Answers
The easiest way would be to use an existing button, and just modify the
action
function, something like this:Coln
Thanks @colin for the reply let me check this in our scenario. Thank you.