How to populate editor once initialised via jquery
See original GitHub issueAm having trouble populating the editor after it has been initialised.
The documentation says you can access the instance and write to it via something like.
$('#textarea-id').wysihtml5().data("wysihtml5").editor.setValue('test');
However this only populates the hidden <input type="textarea">
as opposed to the editor itself.
If I go to the demo (http://xing.github.com/wysihtml5/examples/advanced.html) and execute …
editor.setValue("foobar");
… then the editor gets updated and shows “foobar”. Correctly.
I can use the editor.setValue
as above to populate the editor, but I have multiple editors on a singe plage, so ideally i’d use the first scenario where i can target the instance I want to write to.
Any advice/suggestions?
Issue Analytics
- State:
- Created 11 years ago
- Comments:7
Top Results From Across the Web
JQuery DataTables - Add Editor buttons after initialised
This works in case others are wanting to do the same. var permission = $( '#permission_field' ).val(); var table = $( '#my_table' )....
Read more >Populating Editor via Jquery in UI for ASP.NET MVC - Telerik
I am able to populate Editor programmatically from my model using Alexander's code snippet from ...
Read more >Adding buttons after load. — DataTables forums
I'm just trying to add these standard buttons after the initialise: buttons: [{extend:'remove', editor: editor},{extend:'create', ...
Read more >wp.editor.initialize not working as expected
find('label').each(function() { if (jQuery(this).attr('for')) { var oldFor = jQuery ...
Read more >How to add Summernote Editor in webpage ? - GeeksforGeeks
Create an index.html file & declare the Bootstrap & jQuery links inside the <head> tag. After completing these steps, the project structure ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had a few issues with this until I found this solutions
$('iframe').contents().find('.wysihtml5-editor').html('your new content here');
thanks @gabisajr that was the only solution for me