简体   繁体   English

禁用一些按钮TinyMCE

[英]disable some buttons TinyMCE

Can I somehow by running a javacript command disable some buttons.. 我可以通过运行javacript命令以某种方式禁用某些按钮吗。

Not on the TinyMCE.init , as I need to disable some of the buttons when a special event is happening. 不在TinyMCE.init ,因为发生特殊事件时我需要禁用某些按钮。

I have tried cm.setDisabled(1); 我已经尝试过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? 还是我应该尝试制作一个JavaScript函数,以便每当再次禁用/重新启用按钮时都可以调用该函数?

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 要禁用特定按钮,您需要该按钮的ID,即您的divId_buttonName

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! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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