Hi,I have grouped shapes inside a group and this main group is made by grouping the groped shapes.
So how can identify that the selected group is top level group(by top level i mean the outer group that covers both the grouped diagrams) or not at the time of ungrouping.
Here is the code for ungrouping.
myDiagram.addDiagramListener(“SelectionUngrouped”, function(e) {
e.parameter.each(function(part) {
part.movable = true;
part.resizable = true;
part.rotatable = true;
});
});

You can check the Part.containingGroup to see if it is null.
Thanks for the reply.I also don’t want to ungroup grouped shapes if its Part.containingGroup is not null.
myDiagram.addDiagramListener(“SelectionUngrouped”, function(e) {
e.parameter.each(function(part) {
if(part.containingGroup !==null){
//do not ungroup shapes
**}**else{
part.movable = true;
part.resizable = true;
part.rotatable = true;}
});
});
If you want to control whether a user can ungroup, you could set Group.ungroupable accordingly or override CommandHandler.canUngroupSelection.