简体   繁体   中英

disable some buttons TinyMCE

Can I somehow by running a javacript command disable some buttons..

Not on the TinyMCE.init , as I need to disable some of the buttons when a special event is happening.

I have tried cm.setDisabled(1); but that makes all buttons disabled.

Any ideas if there is a call for that? Or should I try make a javascript function which i can call whenever to disable/re-enable a button again?

Try to follow this fiddle..

Here Bold and Save buttons get disabled on clicking Disable button
and enabled on clicking Enable button.

Buttons are at the bottom of the page

For disabling a specific button you need id of that button which is your divId_buttonName like

tinyMCE.activeEditor.controlManager.get('disable_save').setDisabled(true) ;

In order to enable it again

tinyMCE.activeEditor.controlManager.get('disable_save').setDisabled(false) ;

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM