Enable autogrow feature of CKEditor

In a xPage project the customer asked us if the following would be possible: ” When the content of the richtext editor exceeds the height of the richtext editor we want to have it expanded” . And this is ofcourse possible!

The richtexteditor is based on the CKEDITOR plugin ( since 8.5.2 ). There is a plugin which does exactly that what the customer wanted. The Autogrow plugin. To enable it in your xpage you simple have to define it as an extraplugin using a dojo attribute. See the following line of code:

<xp:inputRichText value="#{document1.body}" id="rtNode">
 <xp:this.dojoAttributes>
  <xp:dojoAttribute name="extraPlugins" value="autogrow"></xp:dojoAttribute>
 </xp:this.dojoAttributes>
</xp:inputRichText>

This way you can add extra plugins you want to load in the ckeditor. If you want to have multiple plugins being loaded you only need to separate the plugin names with a comma. I haven’t found out yet how to add plugin settings using this attribute. 🙁

update: I tested it today on 8.5.3 fp1 and 9 and both seem to work perfectly.

1 thought on “Enable autogrow feature of CKEditor”

  1. Jeroen, nice feature.

    I will keep this in mind, for my projects.

    For a customer I made a fully configurable toolbar of the Editor. On an XPages he can specify which plugins should be loaded. The settings I keep in a managed bean.

    And Every Editor benefit from these settings

     

     

     

     

     

    Reply

Leave a Reply to Frank van der Linden Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.