Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set dynamic content inside editor #147

Open
vincentli99 opened this issue Aug 14, 2016 · 2 comments
Open

set dynamic content inside editor #147

vincentli99 opened this issue Aug 14, 2016 · 2 comments

Comments

@vincentli99
Copy link

Thank you for offering this good gem!
I had a difficulty to set dynamic content within the editor. It is not simple like $('#textarea').html("updated content"). Finally I found a great solution from: https://www.codementor.io/tips/0643978211/update-wysihtml5-editor-content-dynamically-using-jquery
That is:
$('#textarea-id').data("wysihtml5").editor.setValue('new content');
Is it possible to put it in the readme doc? I believe it will help many developers. Thank you!

@Nerian
Copy link
Owner

Nerian commented Nov 18, 2016

Sure, feel free to make a Pull Request with this change and I will merge it.

@jhourlad
Copy link

jhourlad commented Apr 16, 2017

I'm actually having trouble with that. Not sure if that actually works.

$('#backlogEditModal textarea[name="description"]').wysihtml5({  image:false });
......
$('#backlogEditModal textarea[name="description"]').data("wysihtml5").editor.setValue(data.description);

Gives me

Uncaught TypeError: Cannot read property 'setValue' of undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants