How to put icon on top of my block after replace menu entries

Hello,
I’m making a custom item menu and after selecting a certain type, I need this small icon to appear on top of this block

const popupMenuProvider = {
getPopupMenuEntries: function (element) {
return {
‘entry-1’: {
label: ‘Main classificator’,
imageUrl: WebRequestBlock.webRequest,
action: function () {
popupMenu.close();
alert(‘I have been Menu1 clicked!’); };}
///???
};

Thanks in advance

Could you please clarify what you want to achieve? Maybe provide a sketch of what it should look like. Please also clarify which version of bpmn-js you are using.

“bpmn-js”: “^11.1.0” versions,
I want that when selecting a certain view from menu entries, a small icon appeared on top of my block
as shown in the picture
image
image

The icons displayed in the menu are unrelated to the icon displayed in the elements. Clicking a default replace menu entry triggers the creation of a certain element type. Do you wish to have a custom element and add the correspondent entry for it in the replace menu?

yes, i have a custom element in menu entries and after clicking on it, I want the type to change to a custom block

If you already have created a custom element, then you need to define the entry action that will replace the current element for you new custom one.

You can see how this is implemented in the original replace menu.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.