You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/documents-api.md
This how-to describes how to create context menus for a document editor that execute previously registered commands.
9
+
This how-to describes how to create context menus for a document editor that execute previously registered commands. In the example below, you create a menu which is shown for each entity in the domain model of Studio Pro.
10
10
11
11
## Prerequisites
12
12
@@ -17,9 +17,15 @@ Before starting this how-to, make sure you have completed the following prerequi
17
17
18
18
## Creating a Context Menu
19
19
20
-
In the example below, you create a menu which is shown for each entity in the Domain model editor of Studio Pro. In order to specify which type of document a menu should belong to, you need to use the full name of the document type, i.e. `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself. For more information on these document types, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
20
+
{{% alert color="info" %}}
21
+
Use the full name of the document type (for example, `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself). For more information about these document type names, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
22
+
{{% /alert %}}
23
+
24
+
The code below does the following:
21
25
22
-
First, a command must be registered through the [Commands API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/), then the `commandId` can be attached to the new menu. Afterwards, using the `documents` API's `addContextMenu` method, the menu can be added to an entity inside the Domain model editor.
26
+
1. Registers a command through the [Commands API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/)
27
+
2. Attaches the `commandId` to the new menu
28
+
3. Uses the `documents` API's `addContextMenu` method to add the menu to an entity inside the domain model editor
@@ -56,6 +62,6 @@ The command must be registered before creating the menu.
56
62
57
63
## Extensibility Feedback
58
64
59
-
If you would like to provide us with some additional feedback, please complete a short [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback)
65
+
If you would like to provide additional feedback, you can complete a short [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback).
0 commit comments