why i cant export my color to excel
why i cant export my color to excel

function getGroupInfo() {
var mrno2 = $('#mrno2').val();
var mat2 = $('#matcd2').val();
var wosno = $('#wosno').val();
var jenis = $('#jenis').val();
var periode2 = $('#tanggal2').val().replace(/-/g, '');
var whno2 = $('#whno2').val();
var group = $('#groupid').val();
// Destroy existing DataTable instance, if it exists
if ($.fn.DataTable.isDataTable('#tblgroupinfo')) {
$('#tblgroupinfo').DataTable().destroy();
}
const table = $('#tblgroupinfo').DataTable({
processing: true,
language: {
processing: '<i class="fas fa-spinner fa-spin"></i> Loading...',
loadingRecords: '<i class="fas fa-spinner fa-spin"></i> Loading...'
},
dom: '<<"div"<"col-sm-4"l><"col-sm-12 text-end my-2"B><"col-sm-4" <"pull-right"f>><t><"col-sm-6"i><"col-sm-6" <"pull-right"p>>>>',
buttons: [{
extend: 'excel',
text: 'Export to Excel',
title: 'MR GROUPING INFO',
className: 'export-excel-btn',
exportOptions: {
columns: ':visible'
},
}, ],
ajax: {
url: "<?='**') ?>",
data: {
mrno2,
mat2,
wosno,
jenis,
periode2,
whno2,
group
},
dataSrc: ''
},
columns: [{
data: null,
render: function(data, type, row, meta) {
return meta.row + 1;
}
},
{
coloumn
},
//rest of my coloumn
],
lengthMenu: [
[10, 25, 50, -1],
[10, 25, 50, "All"]
],
lengthChange: true,
searching: false,
ordering: false,
rowCallback: function(row, data, index) {
if (!data.groupId) {
$(row).find('td:eq(10)').addClass('bg-danger');
} else if (data.status === 'PROCESSING') {
$(row).find('td:eq(12)').addClass('bg-warning');
}
},
columnDefs: [{
targets: '_all',
width: '5%',
className: 'text-center'
}]
});
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
This thread should help, it's asking the same thing.
Colin