How can I remove default button class of a datatable?

How can I remove default button class of a datatable?

anemaanema Posts: 14Questions: 7Answers: 0

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

  • slouchyslouchy Posts: 1Questions: 0Answers: 0

    you can use JQ.removeClass("oldClassName") in initComplete event

    like this

    initComplete: function (settings, json) {
            $(".btnInsert").removeClass("dt-button");
    },

This discussion has been closed.