I have tried the code sample only :
.....................
.......................
myDiagram.groupTemplate = // for cells
$(go.Group, "Auto",
{
layerName: "Background",
stretch: go.GraphObject.Fill,
selectable: false,
computesBoundsAfterDrag: true,
computesBoundsIncludingLocation: true,
handlesDragDropForMembers: true, // don't need to define handlers on member Nodes and Links
mouseDragEnter: function(e, group, prev) { group.isHighlighted = true; },
mouseDragLeave: function(e, group, next) { group.isHighlighted = false; },
mouseDrop: function(e, group) {
// if any dropped part wasn't already a member of this group, we'll want to let the group's row
// column allow themselves to be resized automatically, in case the row height or column width
// had been set manually by the LaneResizingTool
var anynew = e.diagram.selection.any(function(p) { return p.containingGroup !== group; });
// Don't allow headers/siders to be dropped
var anyHeadersSiders = e.diagram.selection.any(function(p) {
return p.category === "Column Header" || p.category === "Row Sider";
});
if (!anyHeadersSiders && group.addMembers(e.diagram.selection, true)) {
if (anynew) {
//e.diagram.layout.getRowDefinition(group.row).height = NaN;
//e.diagram.layout.getColumnDefinition(group.column).width = NaN;
}
} else { // failure upon trying to add parts to this group
e.diagram.currentTool.doCancel();
}
}
},
.....................
.....................
As I mentioned I am getting the following output.
To be clear my requirements are as follows:
- Nodes must be kept inside the cell, not on the border of the cell.
- It must keep the user preference provided like The cell size increased should not be decreased/resized
Note:
- with the fix you provided I have commented the two lines.Resize issue solved,but I faced the issue of putting nodes on border.
- I feel the issue is coming on the right border of cell, rest all is working fine