Disable label editing specific element

is it possible to disable specific element ?
i already try this thread

what i want to do is
for example i have 2 task A and B
is it possible to disable label editing task B only ?

Hi @Hauw_Ric,

as an additional to the solution in the thread you mentioned, you could check for the id of the element:

var eventBus = modeler.get('eventBus'),
  priority = 10000;

eventBus.on('element.dblclick', priority, function(context) {
  var element = context.element;

  if (element.id === 'Task B') {
    return false; // will cancel event
  }
});

This requires you to know the 'id’s of the elements. You can also do the same with the name of an element

var businessObject = element.businessObject;
  
if (businessObject.name === 'Task B') {
  return false; // will cancel event
}
1 Like