我可以使用以下方法禁用表格按钮:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
但我感兴趣的实际上是隐藏它。关于如何做到这一点的任何想法?
谢谢!
我可以使用以下方法禁用表格按钮:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
但我感兴趣的实际上是隐藏它。关于如何做到这一点的任何想法?
谢谢!
我自己对 TinyMCE 并不熟悉,但由于您似乎可以通过 javascript 访问元素本身,因此您需要做的就是将其显示属性设置为“无”。
document.getElementById("theButton").style.display = "none";
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.
使用以下内容(使用 jQuery;很容易构建非 jQuery 方法):
var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');