action callbacks inside collection buttons not triggered and enabled: false ignored on nested button
action callbacks inside collection buttons not triggered and enabled: false ignored on nested button

Hi,
I’m using DataTables v2 with the new layout.buttons configuration. I have a collection button with child buttons inside it. The problem is twofold:
The child buttons inside the collection render correctly in the dropdown, but clicking them does not trigger their action callbacks at all.
Setting enabled: false on these nested child buttons does not disable them on initialization as expected; they appear enabled.
Here is a minimal example showing the issue:
https://jsfiddle.net/24s0dvrz/
Questions:
Is this a bug or known limitation of DataTables v2 when using layout.buttons with collection buttons?
Should the action callbacks work on nested buttons as usual?
Should enabled: false disable nested buttons on initialization?
Thanks in advance for any clarification.
Answers
The action isn't being called because the collection buttons never become enabled. The
button-selector
you are using, ieactionsCollection.withdrawBtn:name
, is not correct and won't select any button to enable/disable. You only need to provide the specific buttons name, for examplewithdrawBtn:name
. Use this instead:Updated test case:
https://jsfiddle.net/47v1gywL/2/
I added the datatables.css and buttons.css to show the styling of the buttons to see if they are enabled.
Kevin
You have
enable: false,
on the top level button but it should beI commented out these lines so you can see the
buttons.buttons.enabled
does work on the collection buttons:https://jsfiddle.net/wrstL0e9/
Click Actions without selecting a row to see the disabled collection buttons.
Kevin
Makes perfect sense. Maybe i have some problems with loading datatables.
You probably will have done yesterday, but things should be back to normal now. Does the CDN link you are using load okay for you? It is loading here, but there are some reports of caching errors that are taking a little while to clear.
Allan