2013-04-29 49 views
1

我该怎么做?下面是自定义的控制,我们有:jwysiwyg使用自定义控件在光标处插入文本

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" 
} 

我试过其他的解决方案中插入一个文本区域的文字,但他们没有工作(无任何响应,没有错误),或者他们没有设计工作与自定义控件。

回答

1

我面临同样的问题和解决方案是非常简单:

my_button: { 
    visible: true, 
    groupIndex: 100, 
    tooltip: "button", 
    exec: function() 
    { 
     $("selector").wysiwyg('insertHtml', 'some text'); 
    } 
}