scroll bar on field

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a field in a field editor that when in read-only mode, i wish for it to have a scroll bar.

This particular field holds the contents of an email, therefore lots of characters over various lines.

I understand I can restrict the amount of characters visible, but this forces the user to view the record in edit mode if they are to view the contents of the whole field.

Is there any way of adding a scroll bar to a read only field 

Photo of Glenn Daly

Glenn Daly

  • 1,270 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Glenn,

I don't believe you can do this declaratively. Instead, I think it's the perfect place to use a custom field renderer (that links to a table's custom field renderer example, but it's a similar principle for a field in a field editor). A start for the field renderer snippet might be something like

var field = arguments[0], value = arguments[1], $ = skuid.$;
if (field.mode == 'read') {
    //custom code here
} else if (field.mode == 'edit') {
skuid.ui.fieldRenderers.TEXTAREA.edit(field,value);
}

Here's the documentation for a field of type TEXTAREA. You might also find this community post helpful, although the situation is different from yours.
(Edited)