How to make a custom button behave like built-in buttons?

How to make a custom button behave like built-in buttons?

VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

If a row is selected then my button is enabled and vice versa.
I don't want to catch select.dt/deselect.dt and control reload and filter. I want to use behavior of built-in buttons)

The only thing I could come up with:
{ text: 'My button', extend: 'edit', action: function( e, dt, node, config ) {} }
but I'm not sure this is a right way to use ...

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin
    Answer ✓

    You mean you want a button that is enabled only when a row is selected? If so, extend the selected button type.

    Allan

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Wow! Thanks!!! How could I miss that?

This discussion has been closed.