Open bekab95 opened 6 years ago
<script type="text/javascript">
$('.control-group a').click( function(e) {e.preventDefault();
for(var instanceName in CKEDITOR.instances)
CKEDITOR.remove(CKEDITOR.instances[instanceName]);
CKEDITOR.replaceAll('ckeditor');
return false; } );
</script>
This was a solution.. I am filtering click events by control-group
If You Don't save and add another document unsaved document will be lost !
Is this a Flask-Admin issue, or just a problem with your own javascript? I don't understand exactly what you're describing in your first post. Can you give some code for reproducing the issue?
@petrus-jvrensburg
class Story(Document):
texts = ListField(EmbeddedStories)
class EmbeddedStories(EmbeddedDocument):
position = IntField()
image = ImageField(size=(1920, 950), thumbnail_size=(640, 316))
text= StringField() - **this is textarea**
is_enabled = BooleanField()
image_big_link = StringField()
image_thumb_link = StringField()
So.. When I can add list of documents which has .ckeditor textarea class, after adding list item ckeditor is not creating instance for that textarea. I was trying to make new instance for newly inserted textarea, this is a bit flask admin feature with mongoengine and a bit of ckeditor..
I want to reload ckeditor after adding new embedded field which has ckeditor textarea.. If I save document and open it again ckeditor will work but this is not solution, I just need reloading ckeditor js clicking on buttons for adding new fields
I googled and https://github.com/galetahub/ckeditor/issues/575#issuecomment-131583849 this solution does not work