Export options - Modifier - Do not export table head
Export options - Modifier - Do not export table head
Hi,
two short questions. I've a button like this:
extend: 'copy',
text: 'Copy selected rows to clipboard',
exportOptions: {
modifier: {
selected: true
}
}
1) I don't want it to copy the first column. How can I archive this?
2) I dont' want it to copy the table head. Just the plain data. Is there an option for that?
Thank you so much for your help.
Edit: There was an easy setting in the previous version of Datatables: http://legacy.datatables.net/extras/tabletools/button_options (bHeader and mColumns), but I can't find any information how to use them in 1.10+. Also, how I can use mColumns to deselect the first column instead of listing every enabled column. Any help would be appreciated.
Edit2: I'm using the nightly, that's why I'm not affected by the 'export selected rows' bug.
This question has accepted answers - jump to:
Answers
copyLook at the available optionsAlright, thanks. So there's just one question left: How can I exclude a specific column from copy?
Edit: changed row to column
In the same
copypage, look at theexportOptionsoptions, itbuttons.exportData(), the very first one listed on there isrows, which takes any type ofrow-selector, so you can pass it an anonymous function that will select whatever rows you want.As an example, heres the value of my
exportOptionsfor my button, if any rows are selected, then it will only export those selected rows, if no rows are selected, then it will export all rows..Heres an example I created, it uses
printinstead ofcopy, but for some reason, the copy didnt work in there, might have something to do with it being inside a jsbin instance.. but theexportOptionslogic is the sameThat also strips off the header of the table
Oh, my bad. I meant 'how to exclude specific columns from copying'. I'm so sorry. Thank you for your help anyway, even though it's not the solution I'm looking for.
Well in that case, theres also a
columnsoption which takes acolumn-selector, just like the rows