sNewLine equivalent?
sNewLine equivalent?
How would I do the equivalent of "sNewLine" from the old "oTableTools" / "aButtons" params? I have a button that lets people get a list of comma separated IDs from all of the rows.
buttons: [
{
extend: 'copyHtml5',
text: 'Copy IDs',
header: false,
//rowSeparator: ', ',
exportOptions: {
columns: [3]
}
},
],
This discussion has been closed.
Answers
There is no option for that in Buttons. What you would need to do is use the
customize
option of thecopyHtml5
button type to modify the data to suit your needs.Allan
i figured that, but i can't find any examples of the use of customize anywhere. i'll see if i can hack it together from the description of customize.
this does exist as a config param actually. in my efforts to figure out customize I discovered it in buttons.html5.js. Yahoo. It's just newLine.
unrelated: I noticed is that config.customize is called after _exportData( dt, config ); If you're working with large datasets the customize call has to wait for it to first process data the default way and then it gets overwritten with the customized version. Maybe skip _exportData if customize is set.
I had a feeling it was in there, but it was missing from the documentation. Doh - sorry.
I've committed the change and it will be published on the site shortly.
Customize is really there to allow the data that
_exportData
gathers or sets up to be customised. it is possible to use the DataTables API to get your own data, but that wasn't the primary goal of that option.Allan