Hi,
I'm new to using CKEdit and unfortunately the documentation is a little bit light right now. What's the best way to open a dialog one it's been registered. For example if I had the following element in an existing dialog
What would be the line of code to open the dialog after it's been registered in the click event? Obviously I need to do a (my_just_added_dialog).show(). What I'm not sure about is how to get the dialog I just registered?
Thanks in advance for any help!
I'm new to using CKEdit and unfortunately the documentation is a little bit light right now. What's the best way to open a dialog one it's been registered. For example if I had the following element in an existing dialog
{
type : 'button',
id : 'browse',
align : 'center',
label : editor.lang.common.browseServer,
hidden : false,
onClick: function() {
//load the image browser dialog
var dialog = this.getDialog();
dialog.hide();
CKEDITOR.dialog.add( 'testOnly', function( editor )
{
return {
title : 'Test Dialog',
resizable : CKEDITOR.DIALOG_RESIZE_BOTH,
minWidth : 500,
minHeight : 400,
contents : [
{
id : 'tab1',
label : 'First Tab',
title : 'First Tab Title',
accessKey : 'Q',
elements : [
{
type : 'text',
label : 'Test Text 1',
id : 'testText1',
'default' : 'hello world!'
}
]
}
]
};
});
}
}
What would be the line of code to open the dialog after it's been registered in the click event? Obviously I need to do a (my_just_added_dialog).show(). What I'm not sure about is how to get the dialog I just registered?
Thanks in advance for any help!

Re: What's the best way to open a dialog
CKEDITOR.plugins.add( 'apexbrowser', { init : function( editor ) { var pluginName = 'apexbrowser'; // Register the dialog. CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/apexbrowser.js' ); // Register the command. editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) ); } });(function() { var apexbrowserDialog = function( editor) { return { title : 'Select', minWidth : 420, minHeight : 310, onShow : function() { }, onOk : function() { }, onLoad : function() { }, onHide : function() { }, contents : [ { id : 'tab1', label : 'First Tab', title : 'First Tab Title', accessKey : 'Q', elements : [ { type : 'text', label : 'Test Text 1', id : 'testText1', 'default' : 'hello world!' } ] } ] }; }; CKEDITOR.dialog.add( 'apexbrowser', function(editor, data) { return apexbrowserDialog(editor, data); }); })();{ type : 'button', id : 'browse', align : 'center', label : editor.lang.common.browseServer, hidden : false, onClick: function() { editor.execCommand('apexbrowser'); } }