functions Action

An action to run functions on relevant components.

{
  "functions": {
    "ids": {
      "someTextAreaID": "caretstart"
    }
  }
}

This is similar to using an action type "function", but offers additional flexibility by being able to run functions as a result of a script, or after components have been updated.

Note

Where available, functions are documented per component.

Properties

ids
OBJECT

A map of component ids to function names to run on that component.

Function names can be either a single STRING or an ARRAY of STRING for the names of the functions you want to run.

Examples

Select next item in a picker

{
  "type": "view",
  "layout": "inline",
  "direction": "vertical",
  "components": [
    {
      "id": "examplePicker",
      "type": "picker",
      "items": [
        {
          "text": "First item"
        },
        {
          "text": "Second item"
        },
        {
          "text": "Third item"
        }
      ]
    },
    {
      "type": "button",
      "text": "Select Next",
      "events": [
        {
          "triggers": "actioned",
          "action": {
            "type": "json",
            "src": {
              "functions": {
                "ids": {
                  "examplePicker": "selectnext"
                }
              }
            }
          }
        }
      ]
    }
  ]
}