bpmn1
April 26, 2022, 8:17am
#1
How do you open a popup menu? Is it possible to do this anywhere in the canvas?
I saw this function in diagram-js:
PopupMenu.prototype.open = function(element, id, position){}
Could someone explain what these 3 arguments are?
Would it be possible to open a popup within a popup (like a submenu)?
In previous threads I have seen users mention to use a custom provider like the ReplaceMenuProvider.js file. Is there a more intuitive way to open popups?
Also came across this closed issue on the diagram-js github page:
opened 11:16AM - 30 Jan 15 UTC
closed 04:33PM - 11 Mar 15 UTC
Need some service that open an html pop-up at a given position. This could be a … general component used at various positions throughout the diagram.
### Usage Snippet
``` javascript
var options = {
choices: {
'a': { image: '...', className: '...', label: '....' },
'b': { .... }
},
select: function(event, choice) {
alert('user clicked choice');
}
};
var popup = Popup.open(position, options);
// manually close
popup.close();
// automatically close on diagram click (?)
```
Can anyone explain what the solution was?
The context pad is a good example of how to open a registered popup menu.
popupMenu.open(element, 'bpmn-replace', position);
So, as you see, the options mean the following
element
: the currently focussed element
id
: the id of a registered popup menu, e.g. bpmn-replace
position
: the x and y coordinates where the menu should appear
Would it be possible to open a popup within a popup (like a submenu)?
Can you maybe open another thread for this (to keep the discussion focused) and give some more details? How should your popup menu look like?
system
closed
May 5, 2022, 7:28am
#3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.