Not possible to add class, attr, ... to button "columnsToggle"?
Not possible to add class, attr, ... to button "columnsToggle"?

Hello,
Is this wanted behaviour or just a bug, that it isn't possible to extend "columnsToggle" with custom class or attr?
I'm not sure, if I'm reading the documentation correclty. but generally it should work like this?
buttons: [{
extend: 'columnsToggle',
className: 'my-custom-class',
attr: {
myData: "example"
}
}]
I.e. it is working, when extending "colvisRestore".
Thank you,
Adrian
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @adrian2k7 ,
Yep, that looks like a bug. I've raised it internally (DD-1246 for my reference) and we'll report back here when there's an update.
In the meantime, you can add the class and the property in the
initComplete
function like this.Cheers,
Colin
Thank you.
You have a typo in your answer, you propably mean https://datatables.net/reference/option/initComplete
I did, thank you
I've updated my last reply so as not to confuse others.