Hi Gareth,
Please use selectionChange event to achieve your requirement. Please refer to the code example and JSPlayground link below.
Code example:
$("#diagram").ejDiagram({
//define selectionChange event
selectionChange:selectionchange,
});
function selectionchange(args) {
if (args && args.element && args.state === "changed" && args.elementType === "pseudoGroup") {
var diagram = $("#diagram").ejDiagram("instance");
//get the selected nodes
var nodes = diagram.model.selectedItems.children;
for (i = 0; i < nodes.length; i++) {
var node = nodes[i];
//update borderColor for node
diagram.updateNode(node.name, { borderColor: "red" });
}
}
}
In the above sample, when you ctrl+mouseclick on the node(For pseudoGroup elements), the node’s borderColor is highlighted with red Color.
Regards,
Shyam G