Can a selector option be applied to a custom button
Can a selector option be applied to a custom button
I'm just wondering if it's possible to do something like this with a custom button.
buttons: [
text: "Set selection",
name: "DOESelect",
className: 'DOEcustom',
oSelectorOpts: { filter: 'applied', order: 'current', page: 'all' },
action: function ( e, dt, node, config ) {
setSelection("set", dt.column(0).data());
]
I always get the the full table rather than the filtered results. "setSelection" is an Ajax call. My other buttons all work fine with the filtered results.
Replies
I'm not familiar with
oSelectorOpts
but a quick search of the forum it looks like it might be a TableTools (old/retired extension) option. These examples show how to use row and column selectors with the Buttons extension:https://datatables.net/extensions/buttons/examples/print/select.html
https://datatables.net/extensions/buttons/examples/print/columns.html
Not sure they will apply to custom buttons though.
Are you trying to filter the data sent to this function in this statement?
If so then use the
selector-modifier
in thecolumn()
parameters. Something like thisdt.column(0, { filter: 'applied' }).data())
.Are they using the built in export functionality or are they custom buttons?
Kevin
dt.column(0, { filter: 'applied' }).data()).
you nailed it. Exactly what I was looking for. Thanks.