I'm making a form field with FOSCKEditorBundle, which simply generates the CKEditor. The problem is, that I have to catch the onChange event on that generated editor window. I've tried with this:
$builder->add('description', CKEditorType::class, array(
'label' => false,
'config' => array(
'toolbar' => 'basic',
'on' => 'change: function(){unsaved = true; console.log("changed!");},'
),
));
...but no effect. I did this following the CKEditor & FOSCKEditor documentation.
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
https://symfony.com/doc/master/bundles/FOSCKEditorBundle/usage/toolbar.html
Is there any way to set onChange event, like from the form generation site or client site? Doesn't matter for me, but I don't want to edit the config.yml.
Here is the solution: iFrame src change event detection?
We can fire onChange by onLoad, which fires up on every change of state in iframe generated by CKE.