I am having problems in setting the focus in instanceReady event of CKEditor 3.4.1. I have already tried the following two ways but both of them are not always working.
CKEDITOR.on('instanceReady', function(e) { CKEDITOR.instances.editor1.focus(); });
CKEDITOR.replace('editor1',
{
on :
{
instanceReady : function( ev )
{
ev.editor.focus();
}
}
} );
or maybe try this, this is much simpler:
use startupFocus : true
so your code should look like this:
CKEDITOR.replace('editor1',
{
startupFocus : true,
...
here you go my friend
CKEDITOR.replace('editor1',
{
on :
{
instanceReady : function( ev )
{
CKEDITOR.instances.editor1.focus();
}
}
} );
or
CKEDITOR.replace('editor1',
{
on :
{
instanceReady : function( ev )
{
this.focus();
}
}
} );
CKEDITOR.instances['instance-name'].on('instanceReady', function (event) {
CKEDITOR.instances['instance-name'].focus();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With