Hi Karthick,
- In a group node, when you double click on the empty space in-between the group, the double click event raises in which you will get a group node in args.element and you can find an group’s children in the group’s children property. so you can iterate an children and set an fillColor for it. Please refer to the code example and playground link below
Code example:
$("#diagram").ejDiagram({
//define doubleClick event
doubleClick: doubleClick,
});
function doubleClick(args) {
var diagram = $("#diagram").ejDiagram("instance");
var node = args.element;
if (args.elementType === "group") {
for (var i = 0; i < node.children.length; i++) {
var child = diagram.getNode(node.children[i]);
diagram.updateNode(child.name, { fillColor: "red" });
}
}
}
- In a group node, when you double click on the group’s children, you will get a selected children in args.element and you can set a fillColor for that children. If you need to find a parent for that children, we have parent property in node to retrieve the parent node.
Code example:
function doubleClick(args) {
var diagram = $("#diagram").ejDiagram("instance");
var node = args.element;
if (args.elementType === "node") {
diagram.updateNode(node.name, { fillColor: "red" });
//to get a parent node
var parent=diagram.getNode(node.parent)
}
}
Please refer to the below help documentation which shows how to define doubleClick event.
Please let us know if you need further assistance on this.
Regards,
Shyam G