Updating Elrte Content By Ajax Call


in my view i create a RTE by calling the widget:


    $this->widget('application.extensions.elrte.elRTE', array(

        // required object CModel


        // reqired attribute of model


        // see available languages on elRTE documentation site


        // editor height in pixels


        // see available toolbars on elRTE documentation site


        // use <span> with style or HTML tags


        // allow user to edit source




this transform plain text area "body" to a nice working RTE:

		<?php echo $form->labelEx($model,'body'); ?>

		<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>

		<?php echo $form->error($model,'body'); ?>

Now I want to update RTE Content by ajax, so the javascript call (as documented) would be in my case


(while data.html_body is some json ajax response)

Now my problem: whatever I try, the selector $("#MyModel_body").elrte does not seem to work in my case. The stated javascript call has no effect but also does not throw any error in console

What am I doing wrong?

Thanks in advance for some tips…

Switched to redactor as an alternative option. Really nice wysiwyg-editor with smooth GUI…

…and what is important to me: the javascript api call


works like a charm! :)

A special thanks to @samdark for his effort on licensing redactor for Yii