I suspect this is easy, but I’m new to the platform and I’ve already wasted a couple hours on topics very tangential to this experimenting, looking through samples, and the forum.
I’m customizing the basic example to make moving nodes into & out of groups easier. I have successfully implemented a “Add Node in Group” function with the following code:
makeButton("Add Node in Group",
function(e, obj) { // OBJ is this Button
var contextmenu = obj.part; // the Button is in the context menu Adornment
var part = contextmenu.adornedPart;
myDiagram.startTransaction('context menu click');
myDiagram.model.addNodeData({"text":"default text","group":part.key});
myDiagram.commitTransaction('context menu click');
}),
My difficulty has been trying to do the reverse.
makeButton("Remove Node from Group",
function(e, obj) { // OBJ is this Button
var contextmenu = obj.part; // the Button is in the context menu Adornment
var part = contextmenu.adornedPart;
myDiagram.startTransaction('context menu click');
//some code to remove the "group" data from this node
myDiagram.commitTransaction('context menu click');
}),
I’ve not yet run into how to simply remove a data property.
Help is appreciated. Noob question, hopefully an easy answer.