我该怎么做?这是我们的自定义控件:
customcontrol:{
groupIndex: 6,
visible: true,
icon: 'includes/images/controlimage.png',
custom:true,
exec: function (){
$('#editor').wysiwyg('setContent', $('#editor').val() + 'texttoinsert');
},
tooltip:"Insert text at cursor"
}
我已经尝试过在文本区域中插入文本的其他解决方案,但它们都不起作用(没有任何事情发生,没有错误),或者它们不适用于自定义控件。
答案 0 :(得分:1)
我遇到了同样的问题,解决方案非常简单:
my_button: {
visible: true,
groupIndex: 100,
tooltip: "button",
exec: function()
{
$("selector").wysiwyg('insertHtml', 'some text');
}
}