Hello,
I’m looking for the way how to disable editing and the double click within a bpmn element.
any clue, thank you in advance
kind regards,
Hello,
I’m looking for the way how to disable editing and the double click within a bpmn element.
any clue, thank you in advance
kind regards,
Within the modeler.
thank you.
I think @philippfromme tried to point out that you could just use the Viewer instead of the Modeler which would prevent all editing.
Anyways: I’d be also interested in this. Especially in how to prevent name-editing by double-clicking.
You can disable editing labels through intercepting the double click event as follows:
// register listener with high priority will make sure it's called first
var priority = 10000;
eventBus.on('element.dblclick', priority, function(event) {
return false; // will cancel event
});
Thank you Philipp,
In which class I can intercept and override the dblclick only for the Bpmn:StartEvent and Bpmn:EndEvent elements?
kind regards,
You can easily check the type of an element and only cancel the event if the element is of a specific type:
var isAny = require('lib/features/modeling/util/ModelingUtil').isAny; // check if element is of any type
var priority = 10000;
eventBus.on('element.dblclick', priority, function(event) {
var element = context.element;
if (isAny(element, [ 'bpmn:StartEvent', 'bpmn:EndEvent' ])) {
return false; // will cancel event
}
});
You can put this into an existing feature or go for a cleaner solution and put this into a seperate module.
Is it possible to deactivate the Direct-Editing Feature when the User clicks on the “Append Task” menu entry in the Context Menu?
eventBus.on(‘element.dblclick’, function(event) {
return;
});