How can I enable/disable custom button in editor
How can I enable/disable custom button in editor
Hi Allan,
I created a couple of custom buttons in Editor of create/edit form, for instance there is a button to save and another to approve.
My question is how can I disable 'approve' button before I save data and enable it after saved data, I checked two reference link below as well as in forums.
https://editor.datatables.net/reference/api/buttons
https://editor.datatables.net/reference/type/button-options
Can you give me some clue?
Thanks,
Wenbin
This question has an accepted answers - jump to answer
Answers
The only method in Editor to control the buttons is the
buttons()
method. And there isn't really a way to disable a button specifically other than to remove it. That might an option for you.Alternatively, what you could perhaps do is use
buttons()
to create both buttons again but have the approve button with a disabled class and no action on itsfn
callback.Allan