7

我可以使用以下方法禁用表格按钮:

  tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)

但我感兴趣的实际上是隐藏它。关于如何做到这一点的任何想法?

谢谢!

4

4 回答 4

7

首先,您必须使用高级主题。

然后,在 TinyMCE 初始化代码中添加此选项。

tinyMCE.init({
    ...
    theme_advanced_disable : "bold, justifyleft, justifyright"
});

我希望这可以帮助某人。

资源

此处的元素名称列表

于 2009-10-20T04:20:50.400 回答
5

我自己对 TinyMCE 并不熟悉,但由于您似乎可以通过 javascript 访问元素本身,因此您需要做的就是将其显示属性设置为“无”。

document.getElementById("theButton").style.display = "none";
于 2009-04-20T21:55:38.183 回答
0

incase ur trying to hide a specific button, use the following code.

$('.mce_cut').hide() //hides cut button

lookup other button titles using firebug in case u wish to hide something specific.

Incase you are looking to hide specific editor's button, modifiy the jquery selector to select correct sibling/descendent.

alternately, try this .. tinyMCE.activeEditor.controlManager.controls.ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords_cut.remove()

Note that ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords is my asp.net control's id. Don't bother about this if ur not using Asp.net serverside textbox control. In case you are.. <% theTextBoxID.ClientID %> gets u that.

于 2011-09-12T14:18:13.940 回答
-1

使用以下内容(使用 jQuery;很容易构建非 jQuery 方法):

var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');
于 2010-12-01T14:51:37.117 回答