Hi,
I add a dialog panel "myDialog" open with "MyButton" on the UI.... , it's Ok !
CKEDITOR.dialog.add( 'myDialog', '/TESTS_WEB/template/TESTS/my_dialog.js');
editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
editor.ui.addButton( 'MyButton',
{
label : 'My Dialog',
command : 'myDialogCmd'
} );
my_dialog.js contain the dialog description
CKEDITOR.dialog.add( 'myDialog', function( editor )
{
return {
title : 'My Dialog',
minWidth : 400,
minHeight : 200,
contents : [
{
id : 'tab1',
label : 'First Tab',
title : 'First Tab',
elements :
[
{
id : 'input1',
type : 'text',
label : 'Input 1'
},
{
type : 'button',
hidden : false,
id : 'tititoto',
label : 'C\'est mon bouton', //editor.lang.common.browseServer,
style : 'float:right',
onclick : 'My_ javascript_ Function()'
},
]
}
]
};
} );
all works good except the onclick declaration...
I dont understand how to execute my_javascript_function() on the button event 'onClick'....
Thanks for your help.
I add a dialog panel "myDialog" open with "MyButton" on the UI.... , it's Ok !
CKEDITOR.dialog.add( 'myDialog', '/TESTS_WEB/template/TESTS/my_dialog.js');
editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
editor.ui.addButton( 'MyButton',
{
label : 'My Dialog',
command : 'myDialogCmd'
} );
my_dialog.js contain the dialog description
CKEDITOR.dialog.add( 'myDialog', function( editor )
{
return {
title : 'My Dialog',
minWidth : 400,
minHeight : 200,
contents : [
{
id : 'tab1',
label : 'First Tab',
title : 'First Tab',
elements :
[
{
id : 'input1',
type : 'text',
label : 'Input 1'
},
{
type : 'button',
hidden : false,
id : 'tititoto',
label : 'C\'est mon bouton', //editor.lang.common.browseServer,
style : 'float:right',
onclick : 'My_ javascript_ Function()'
},
]
}
]
};
} );
all works good except the onclick declaration...
I dont understand how to execute my_javascript_function() on the button event 'onClick'....
Thanks for your help.
Re: Howto execute a javascript function 'onClick' a button
All you need is: