2013-04-29 45 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'); 
    } 
}