popupmenu Action

An action to dynamically create and popup a menu for a given component.

"popupmenu": {
  "src": "componentid",
  "menu": [
    { ... },
    { ... }
  ]
}

Properties

src
STRING

The id of the component you would like the popup menu to show on.

menu
MENU

The MENU configuration for the popup menu.

Examples

Show a menu of sounds when clicked

{
  "id": "menuButton",
  "type": "button",
  "text": "Show Sounds",
  "events": [
    {
      "triggers": "actioned",
      "action": {
        "type": "json",
        "src": {
          "popupmenu": {
            "src": "menuButton",
            "menu": [
              {
                "type": "text",
                "text": "Funk",
                "action": {
                  "type": "json",
                  "src": {
                    "sound": {
                      "src": "Funk"
                    }
                  }
                }
              },
              {
                "type": "text",
                "text": "Glass",
                "action": {
                  "type": "json",
                  "src": {
                    "sound": {
                      "src": "Glass"
                    }
                  }
                }
              }
            ]
          }
        }
      }
    }
  ]
}