Getting Export Button added In Editor
Getting Export Button added In Editor
davidjmorin
Posts: 101Questions: 31Answers: 0
How would I get the export button for CSV to the below code?
new $.fn.dataTable.Buttons( table, [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
] );
My whole Script:
(function($){
$(document).ready(function() {
var editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.rma_submissions.php',
table: '#rma_submissions',
fields: [
{
"label": "rma_number:",
"name": "rma_number"
},
{
"label": "paid:",
"name": "paid"
},
{
"label": "paid_date:",
"name": "paid_date"
},
{
"label": "device_id:",
"name": "device_id"
},
{
"label": "Location:",
"name": "location"
}
]
} );
var table = $('#rma_submissions').DataTable( {
ajax: 'php/table.rma_submissions.php',
columns: [
{
"data": "rma_number"
},
{
"data": "paid"
},
{
"data": "paid_date"
},
{
"data": "device_id"
},
{
"data": "location"
}
],
select: true,
lengthChange: false
} );
$('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this );
} );
new $.fn.dataTable.Buttons( table, [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
] );
table.buttons().container()
.appendTo( $('.col-md-6:eq(0)', table.table().container() ) );
} );
}(jQuery));
This discussion has been closed.
Answers
Figured it out.