How can I remove the Print button when using "buttons: {dom..."

How can I remove the Print button when using "buttons: {dom..."

agrogersagrogers Posts: 3Questions: 0Answers: 0

I was using the options buttons: [] to remove all buttons and then i add my own. But i wanted to style the buttons by applying a class.

So I removed buttons: [] and added buttons: {dom:{button: {tag:'span','className':'btn'}}

That worked nicely but for some reason the 'Print' button appeared. I haven't specified the Print button anywhere.

How can i specify that I don't want a print a button and still apply a class to all my buttons?

Thank you.
Andrew

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • agrogersagrogers Posts: 3Questions: 0Answers: 0
    edited December 2020

    Thanks for the reply Colin. Just saw it now! I ended up solving my problem by following the advice here.

    Maybe my question was poorly framed. But essentially what I needed to know was how to correctly assign (or remove) a class name from a button. I could assign it ok. But the issue was the default 'dt-button' class was also always added to buttons. And that overrode my classes.

    I could rid myself of that class by defining an empty class in the buttons.dom.button.className property.

    The relevant section of my table definition is:

    buttons: {
                    dom: {
                        button: {className:''}
                    },
                    buttons:[]
                },
    

    I define my buttons manually later on.

This discussion has been closed.