How to make the " NEW "button inactive initially.
How to make the " NEW "button inactive initially.
How to make the " NEW "button inactive initially.
I've been trying to do a small task for two hours now – it doesn't work. I need to make the "NEW" button inactive INITIALLY. But it became active when selecting a line.
I looked here, tried it in different ways, and it didn't work out:
https://datatables.net/extensions/buttons/examples/api/enable.html
https://datatables.net/forums/discussion/53387/enable-button-only-if-row-is-selected-and-a-column-has-a-defined-value
https://datatables.net/forums/discussion/55871/enable-button-on-row-select
I will be grateful for your help.
Answers
Use the
buttons.buttons.enabled
to set the initial state. Then use something like the first example you linked to change the state based on selected rows.Kevin
Thank you, I understand. Tell me, how do I access the "NEW" ("Create") button?
Take a look at the
button()
API docs to see how to access the buttons.Kevin
thanks