最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - disable some buttons TinyMCE - Stack Overflow

programmeradmin5浏览0评论

Can I somehow by running a javacript mand 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?

Can I somehow by running a javacript mand 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?

Share Improve this question asked Jan 6, 2013 at 5:15 Mark TopperMark Topper 3471 gold badge6 silver badges14 bronze badges 1
  • 1 tinymce seems to have quite good documentation. tinymce./wiki.php/API3:tinymce.api.3.x – 2pha Commented Jan 6, 2013 at 6:03
Add a ment  | 

1 Answer 1

Reset to default 5

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!

发布评论

评论列表(0)

  1. 暂无评论