Problem: Dynamically loaded text_fields with tinymce_hammer

5 views
Skip to first unread message

hadiS78

unread,
Feb 22, 2010, 10:13:24 AM2/22/10
to tinymce_hammer
Hi,

I have the following Problem:

I use javascript to load text_fields dynamically into a form. the
problem seems now that tinymce_hammer is not aware of loaded
text_fields during runtime and so the text fields stay empty, though
they appear as normal text fields. Is there any workaround or did i do
something wrong?
Thx in advance.

Trevor Rowe

unread,
Feb 22, 2010, 10:27:07 AM2/22/10
to tinymce...@googlegroups.com, hadiS78
TinyMCE doesn't monitor the page for text fields added after page load. When using the tinymce_hammer plugin, you should be able to call the following javascript after page load to add another editor:

TinymceHammer.addEditor('domid');

Be sure to replace 'domid' with the id of the text area you want converted to an editor. The text area must also be ready on the page before you call this method.

Hope this helps!

- Trevor Rowe

> --
> You received this message because you are subscribed to the Google Groups "tinymce_hammer" group.
> To post to this group, send email to tinymce...@googlegroups.com.
> To unsubscribe from this group, send email to tinymce_hamme...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tinymce_hammer?hl=en.
>

hadiS78

unread,
Feb 22, 2010, 12:03:59 PM2/22/10
to tinymce_hammer

Yeah it worked very well. Thanks a lot, u saved me a lot of time. I
additionally found this link for all who are interested
http://blog.mirthlab.com/2008/11/13/dynamically-adding-and-removing-tinymce-instances-to-a-page/
but the tinymcehammer way is much cleaner ;)

Maybe u can help me on my second problem too:

My (tinymce) text areas are inside an accordion (jQuery accordion to
be exactly). The div in which the text area is located is not hidden
at page load and every thing works fine. But whenever i hide the div
and show it again
the tinymce text area is still displaying but it dosen't react anymore
and everything added to the text area before was deleted (and i get
the following error when clicking on the buttons: "t.win.document is
null error").
Any ideas? I guess of showing again i have to call some function to
"reactivate" the text area?!?

Reply all
Reply to author
Forward
0 new messages