Is it possible to include the rowId when exporting?
Is it possible to include the rowId when exporting?
lmartinez
Posts: 8Questions: 5Answers: 2
I am trying to use the export abilities from datatables, instead of trying accomplish this server side. I am trying to include the RowId in my export because I will need it offline but I am having trouble including it. I know there is an export options that i can use but it is not working for me.
This is the beginning of my Columns initialization
columns: [
{
data: 'DT_RowId',
//targets: 0,
orderable: false,
searchable:false,
checkboxes: {
selectRow: true
}
},
{ data: "ManufacturerName", visible: false },
and this is how i defined my button
{
extend: 'excel',
className: 'm-1 btn-sm d-none exportButton',
text: 'Export All',
exportOptions: {
columns: [0, 1, 2,3,4,8,12,13,14,15,16,17,18,26,27]
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That should work correctly. Could you link to a page showing the issue please?
Thanks,
Allan
So I created a workaround for this, I basically added the row Id into another separate column. I didn't put two and two together and didn't realize that it was only exporting what is getting rendered, until I added another column which was rendered a certain way.
So I did some research and came across orthogonal and I included it in my code. Now it works as intended.