Hi
I'm new to the CKEditor and I'm trying to make a new button with a dialog to insert a link to a certain document (which can be selected from a dropdownlist, which I fill)
But how can I get the selected item in the dropdownlist when I push on the button.
Below is my code
I'm new to the CKEditor and I'm trying to make a new button with a dialog to insert a link to a certain document (which can be selected from a dropdownlist, which I fill)
But how can I get the selected item in the dropdownlist when I push on the button.
Below is my code
CKEDITOR.dialog.add( 'myDialog', function( editor )
{
return {
title : 'My Dialog',
minWidth : 400,
minHeight : 200,
buttons:[
{
type:'button',
id:'insertBtn',
label: 'Insert link',
onClick: function(){
var oEditor = CKEDITOR.instances.editor1;
value = '';
/** HERE I WANT TO GENERATE SOME HTML TO INSERT **/
oEditor.insertHtml( value ) ;
},
onLoad: function(){
}
},CKEDITOR.dialog.okButton
],
contents : [
{
id : 'Linktowiki',
label : 'Link to wiki',
title : 'Link to wiki',
elements :
[
{
id : 'input1',
type : 'select',
label : 'Wiki',
style:'width:200px',
items : arrWiki
}
]
}
,
{
id : 'Link to document',
label : 'Link to document',
title : 'Link to document',
elements :
[
{
id : 'input2',
type : 'select',
label : 'Document',
style:'width:200px',
items : arrDoc
}
]
}
]
};
} );

Re: Content from a custom dialog
onClick: function(){ var oEditor = CKEDITOR.instances.editor1; var dialog = this.getDialog(); //or it might be oEditor.getDialog() value1 = dialog.setValueOf( 'info', 'input1' ); //change info to the tab name of your dialog (It should have at least one tab...) value2 = dialog.getValueOf( 'info', 'input1' ); /** HERE I WANT TO GENERATE SOME HTML TO INSERT **/ oEditor.insertHtml( value1 + value 2 ) ; }