Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2011-07-18 08:49:34

ximarin
New member
Registered: 2011-07-18
Posts: 1

use xinha on ajaxed textarea

Hi there,

I have the following problem:

The contents of my page are all created using ajax-requests.

I have added xinha to my page as the newbie guide says, the plugins and the core get loaded correctly but the textarea I want to use as an editor is not transformed as expected.

When I use the same code outside of the head and load it within the ajax-request, everythings works fine the first time, but when I fire the ajax a second time, it does not work anymore.

The third thing I tried was to only call xinha_init() within the ajax and leave the rest in the head (which is only loaded once), but still, it only works the first time, the second time i call the contents, the textarea remains unchanged.

Does anyone know what I could do here?

Thanks!

Offline

#2 2011-07-20 05:09:26

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: use xinha on ajaxed textarea

I expect you'll need to create your own initialisation routine, the example "xinha_init" won't be for you.  Read the function, see what it does, and write your own to do what you need when you need it. 

Read these methods:

Xinha.makeEditors
Xinha.startEditors

in the XinhaCore.js

At a minimum, you need to create a Xinha object and then call generate on it

  var ed = new Xinha(your_textarea, your_xinha_config);
  ed.generate();


James Sleeman

Offline

Board footer

Powered by FluxBB