Hi,
apparently, these two properties are just flags (along with Group.ungroupable Part.groupable) and have no effect on user’ ability to group and/or ungroup nodes using dragging toll (looks similar to Model.isReadOnly).
I tested it on your “regrouping.html” sample.
To change this I probably need to modify dragging tool, but “beforeDropping” which does not exists. Can you please clarify how to prevent particular user from grouping/ungrouping parts?
What I mean is user’ ability to select a node and drag it into a group’ placeholder, or do opposite - drag a node out of a group and place it somewhere else.
That is non-standard behavior, and the only reason it happens in regrouping.html is because of this code:
myDiagram.groupTemplateMap.add("OfGroups",
$(go.Group, "Auto",
{
...
// when the selection is dropped into a Group, add the selected Parts into that Group;
// if it fails, cancel the tool, rolling back any changes
mouseDrop: finishDrop,
...
// Upon a drop onto a Group, we try to add the selection as members of the Group.
// Upon a drop onto the background, or onto a top-level Node, make selection top-level.
// If this is OK, we're done; otherwise we cancel the operation to rollback everything.
function finishDrop(e, grp) {
var ok = (grp !== null
? grp.addMembers(grp.diagram.selection, true)
: e.diagram.commandHandler.addTopLevelParts(e.diagram.selection, true));
if (!ok) e.diagram.currentTool.doCancel();
}
Simply remove that code if you don’t want that functionality.