Set Field Renderer for Field in Javascript

  • 1
  • Question
  • Updated 2 years ago
  • Answered
If i create a new UI-Only field in Javascript, is there any way to define what the field renderer will be when i create that field? 
Photo of rensley

rensley

  • 316 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Pete O'Connell

Pete O'Connell

  • 214 Points 100 badge 2x thumb
They have the same options for renderers as legit fields. I use field JS field renderers all of the time on UI-only fields.

Photo of rensley

rensley

  • 316 Points 250 badge 2x thumb
Sorry, I should be more clear. 

I am creating a field in Javascript and adding it to my model.

After i create the field I want to assign a field renderer in it . All done within Javascript. 
Photo of rensley

rensley

  • 316 Points 250 badge 2x thumb
I was able to figure out a workaround. I define a custom snippet that applies to standard renderer.

When writing the XML for the field in a table, apply the custom snippet
Photo of Pete O'Connell

Pete O'Connell

  • 214 Points 100 badge 2x thumb
Nice! I'll remember that