How work with row selection and export?
How work with row selection and export?
AxelB
Posts: 1Questions: 1Answers: 0
Hello, I have this code:
columnDefs: [ {
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'multi',
selector: 'td:first-child',
blurable: false,
},
buttons: [
{ extend: 'csv',
exportOptions: {
rows: { selected: true }
}
},
]
And export feature ignore my selected .row during export ````<tr role="row" class="even selected">``` (I have 0 result inside my .csv file) and if I remove the exportOptions section, I have all my row inside, why please?
Thanks.
This discussion has been closed.
Answers
I might be missing it but I don't think you can use
selected: true
as arow-selector
. Maybe try using the class as shown in this example:https://datatables.net/reference/type/row-selector#string
Kevin
Kevin is correct - you can't use
{selected: true}
for therows
parameter in the export options. But you can use it for themodifier
option. See thebuttons.exportData()
method's documentation.Allan