Menu

Vecta.Menu

Vecta.Menu object. Wrapper for a custom menu that can be attached to shapes.

NameTypeAttributesDescription
shapeVecta.Shape

The shape to add a menu to

indexnumberoptional

The index of the menu. If undefined, create a custom menu, otherwise use the menu at the provided index.

Methods

.action([action]) Returns: Vecta.Menu

Set or get the action to be performed when the option is clicked

NameTypeAttributesDescription
actionstringoptional

Valid JavaScript expression

Returns:

Returns the menu option

.delete()

Delete the menu options

.disable([action]) Returns: Vecta.Menu

Set the option to be disabled or get the disable status of current menu

NameTypeAttributesDescription
actionstring|booleanoptional

Disabling of menu options. Can be a valid JavaScript expression supported by formula

Returns:

Returns the menu option

.title([title]) Returns: Vecta.Menu

Set or get the title of menu option

NameTypeAttributesDescription
titlestringoptional

Title of menu option. Can be a valid JavaScript expression supported by formula

Returns:

Returns the menu option