disable/enable new button based on selected row (parent/child sollution)
disable/enable new button based on selected row (parent/child sollution)
nessinits
Posts: 86Questions: 27Answers: 0
Hi there,
I'm trying to initially disable the new button of my child datatable when there is no row selected in my parent datatable.
Does anyone have an example how to do this?
Kind regards,
nessinits
This discussion has been closed.
Replies
Here is something similar with two custom buttons. You would need to initially hide the button in order to remove the hidden class when a row is seleced. Hide it again when it is deselected.
I hide and unhide the buttons; I don't disable them but this should also work if you only want the buttons to be disabled and enabled.
https://datatables.net/reference/api/buttons().disable()