Roy Tang
Roy Tang

Reputation: 5761

CKEditor - Can I trigger inline editing programmatically?

I have a CKEditor instance with inline editing enabled. It works fine, but I also have an [Edit] button which I want to trigger inline editing (and focus on the text) when the button is clicked.

Is this possible?

Upvotes: 2

Views: 1753

Answers (3)

HichamEch
HichamEch

Reputation: 715

try this javascript code to solve : focus the ckeditor inline

$(btn).on('click', function(event) {
    event.preventDefault();
    $("#ckeditor_id").focus();
});

Upvotes: 0

You can use like this

CKEDITOR.inline(myId); 

function onButtonClick()
{
    myId.focus();
}

Upvotes: 0

oleq
oleq

Reputation: 15895

You need CKEDITOR.editor.focus() to do this (see on jsFiddle).

Upvotes: 1

Related Questions