How java script will work when field editor component in edit mode?

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have written javascript it's working only when "field editor” is on “read and edit inline” mode ,It's
not working when "field editor"  is on "edit" mode .
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
vicky,

I think you have a custom render (javascript) that works in 'read and edit inline' mode, but not 'edit' mode.  You will need to add to your javascript snippet some code to tell Skuid what to display when in 'edit' mode.  Here is a simple example:

//render the field in read and edit mode
if(field.mode == 'read') {
    
    skuid.ui.fieldRenderers.STRING.read(field, value);
}
if(field.mode == 'edit') {
    
    skuid.ui.fieldRenderers.STRING.edit(field, value);
}

Thanks,

Bill
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb
Thanks Bill.