D
D
dk-web2015-08-29 01:01:02
JavaScript
dk-web, 2015-08-29 01:01:02

How do you save data from CKeditor?

Well, it seems that the final touch is left ...
I'm twisting the content editor. For normal textarea implemented simply. When focus appears, a label appears - editing, when focus is lost - it is saved via ajax.
But with the field that is replaced by ckeditor, there is no complete understanding.
The field does not respond to the standard focus... I
found the following in the documentation:

var focusManager = new CKEDITOR.focusManager( editor );
focusManager.focus();
editor.on( 'change', function( evt ) {
  alert( CKEDITOR.instances.ck.focusManager.hasFocus );
});

But I don't understand how to use it. Returns true when content is loaded - i.e. mouse focus... out of the question.
How can save be implemented?

Well, in pursuit, so as not to produce questions.
53cb40bdb59a46bd8fb2129ed1a9c24d.png
Such a misfortune happened...

The content is loaded by Ajax - it gets into the necessary textarea and suddenly under a hundred such divs with wild positioning.
I don't know where to look.

Thanks in advance for your replies.

UPDATE:
The following construction worked at random...
editor.on('focus',function(evt){
     alert( CKEDITOR.instances.ck.focusManager.hasFocus );
   });

But neither focusin nor focusout work... what other options are there to track the loss of focus?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sashabeep, 2015-08-31
@dk-web

So in the same way blur docs.ckeditor.com/#!/api/CKEDITOR.focusManager-met is described in the helppack...
And moving the mouse away is only by hover out, but the mouse is far from always located over the place where the text is entered

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question