How can I call a modal from a context menu located on the canvas?

Good evening, greetings from Ecuador.
I am trying to call a form that is within a modal. I want to run it from one of the options in the context menu inside the canvas.

That depends on your HTML/JavaScript framework that you are using. It has nothing to do with GoJS.

An example?
I have the context menu part.
myDiagram.contextMenu =
$(go.TextBlock, “New class”),
{click: function (e, obj) {
myDiagram.startTransaction(‘add node’);
var newdata = {name: “BankAccount”};
myDiagram.commitTransaction(‘add node’);
var node = myDiagram.findNodeForData(newdata);;
how would you call the modal?

The button click event handler should show the dialog. The gives you the context-clicked part’s data object, so you can get the properties with which to populate the dialog.

When the user clicks the “OK” button of the dialog, then you can execute the transaction to add some data to the model. Of course the “Cancel” button of the dialog should only clean up the dialog.

How you show and hide dialogs depends on what kind of dialog and framework you are using.

Thanks it worked for me.