enable/disable custom buttons just like Edit/New/Delete
enable/disable custom buttons just like Edit/New/Delete
I have Editor. I've created two custom buttons...
I can .enable()
the buttons on row click .on('click', 'tr', function ()
. I also have the capability to do this with the select event .on( 'select', function ( e, dt, type, indexes )
What I can't figure out is how to handle what happens when there is no selection, specifically after Editor finishes processing a Create, Edit, or Remove action. Like, after a DELETE, there is no selection, yet my custom buttons are still enabled.
How do I get my custom buttons to be toggled in the same way as the built-in Edit & Delete buttons?
One possible caveat is that I don't allow deselects: toggleable: false
This question has an accepted answers - jump to answer
Answers
This Select Extension example shows how to enable/disable buttons based on selected state:
https://datatables.net/extensions/select/examples/initialisation/buttons.html
Kevin