How do I give fields different edit modes (in-line, read only, edit) in the same field editor?

  • 2
  • Question
  • Updated 4 years ago
  • Answered
So, the field editor can be set to edit mode, read with in-line editing, and read only. However, I'd like to have checkboxes be in edit mode (so I don't have to click the pencil/edit button in order to check the box) while having the rest of the field editor in in-line mode. Is it possible to set some fields to one kind of edit mode and others to another?
Photo of Matt Brown

Matt Brown, Employee

  • 808 Points 500 badge 2x thumb

Posted 6 years ago

  • 2
Photo of Matt Brown

Matt Brown, Employee

  • 808 Points 500 badge 2x thumb
From Anna Wiersema:

Go into the page where you want this to be, and click to add an inline javascript snippet. add this:

var field = arguments[0],
value = arguments[1];
field.mode = 'edit';

var renderers = skuid.ui.fieldRenderers;
var dt = field.metadata.displaytype;
var r = renderers[dt];
if (!r) r = renderers.TEXT;
r.edit(field,value);

Then, click on the field that you want in the editor and for Field Renderer choose custom and enter the name of your snippet. and voilĂ . it's in edit mode.