How can I remove default button class of a datatable?
How can I remove default button class of a datatable?
I am using Data table with Button. I want to show Success button rather default. I tried this Code
buttons: [
{
extend: "excel",
className: "btn-sm btn-success",
titleAttr: 'Export in Excel',
text: 'Excel'
}]
This code is working but this is adding btn-success class, But I want to remove the btn-default class first and then add the success class.
Current Classes: "btn btn-default buttons-excel buttons-html5 btn-sm btn-success"
What I want : "btn buttons-excel buttons-html5 btn-sm btn-success"
Answers
you can use JQ.removeClass("oldClassName") in initComplete event
like this
initComplete: function (settings, json) {
$(".btnInsert").removeClass("dt-button");
},