Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

SimpleHTMLEditorField


Reply

4 Posts   1251 Views

Avatar
hunman

3 March 2011 at 5:25pm Community Member, 18 Posts

Hello,

I have created a new admin module and I am using SimpleHTMLEditorField in the form like this:

function getEditForm($id) {
      
      $validator = new RequiredFields('article_name', 'article_date','article_content');   
         
      // Create form fields
      $fields = new FieldSet(
         // TODO The ID field needs to be hidden but while testing make it readonly
         new ReadonlyField('ID','id #',$id),
         new TextField('article_name', "Article Name", ""),
         $dateField = new DateField('article_date', "Article Date", ""),
         new CheckboxField('article_publish',"Publish",""),
         new CheckboxField('article_archive',"Archive",""),
         new SimpleHTMLEditorField('article_content', "Content")
         
         
         
      );

The SimpleHTMLEditorField shows when the form loads normally, but it does not show when the form loaded using ajax on the right area of admin panel.

How can I get the SimpleHTMLEditorField working in Ajax form ? Please Help ?

Thanks

Avatar
UncleCheese

4 March 2011 at 4:35am 4085 Posts

I think you would need to load jquery.livequery.js and change the JS function that loads SimpleHTMLEditor field to use a livequery handler..

Avatar
hunman

4 March 2011 at 7:06pm Community Member, 18 Posts

Thanks UncleCheese.

How should I change the JS function to, that loads SimpleHTMLEditorField ?

Also, I want to show HTML editor similar to the one being used in the CMS admin, how can I include all those options in SimpleHTMLEditorField ?

Avatar
UncleCheese

5 March 2011 at 3:48am 4085 Posts

You're not going to be able to do that. That instance of TinyMCE has been heavily customised and pretty well baked into CMSMain.