Row Action Javascript Snippet

  • 1
  • Question
  • Updated 9 months ago
  • Answered
Photo of Shaun Dickett

Shaun Dickett

  • 160 Points 100 badge 2x thumb

Posted 9 months ago

  • 1
Photo of Mike Dwyer

Mike Dwyer

  • 3,380 Points 3k badge 2x thumb
Is there a question, Shaun?
Photo of Shaun Dickett

Shaun Dickett

  • 160 Points 100 badge 2x thumb
Mike

The question is how do I create a row action snippet that turns table fields on the row in focus to edit mode.

Regards
Glen McGoldrick
Photo of Mike Dwyer

Mike Dwyer

  • 3,380 Points 3k badge 2x thumb
Just curious why you wouldn't just use the built-in row action.


Otherwise, you attach a renderer to a column in the table:


In the javascript, you want these statements:

var field = arguments[0];
var value = arguments[1];
var renderer = skuid.ui.fieldRenderers[field.metadata.displaytype].edit( field, value );

Instead of the edit mode, you can use read. Or, for a dynamic setting, use [field.mode].