How to return a rich text field in the custom renderer

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi I'd like to create a UI only field with rich text editor. Is that possible in Skuid? The text area field does not render the CKEditor controls. I see there is editor property on Field. How do I set that to use CKEditor control?
Photo of Janet

Janet

  • 486 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
This topic has two questions: 
1. The UI only field of type "Text area" does not render a Rich Text field - rather it renders a long text field. 

The question about exposing the CKEditor contorls without having a RTF in the back end field is still open.  Question for tomorrow. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
J...

Have you inspected the html on a real rich text field? There may be a way to enable CKeditor controls with jQuery by applying the same html/css to your textarea.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You do need to add a little bit of Javascript to turn on the html editor in the rich text field.  Add an inline resource with the following code: 

(function(skuid){    skuid.events.subscribe('skuid.models.initialized',function(){
        skuid.$M('ModelName').getField('UIONLYFIELDNAME').htmlFormatted = true;
    });
})(skuid);
Photo of Janet

Janet

  • 486 Points 250 badge 2x thumb
The only issue that I have right now is when I try to read the UI only text area field by row.ui_field, it always returns null. The value gets set from the custom field renderer and it shows on UI correctly.