Hi All,
I’ve taken the SwimLanes example and removed the restrictions so the lanes can be moved around, all working the way I had hoped.
I’ve then tried to add a Palette so to have one node entry for the Lane and another for the node that goes into the Lane:
// create the Palette
var myPalette =
$(go.Palette, "myPalette");
myPalette.nodeTemplate =
$(go.Node, "Vertical", //node template is a Node object (can have a Panel layout)
$(go.Panel, "Auto",
$(go.Shape, "RoundedRectangle", new go.Binding("fill", "color"),
{ height: 40, width: 40, fill: "white" }),
$(go.TextBlock,
{
font: "bold 11pt Helvetica, Arial, sans-serif",
//stroke: lightText,
margin: 8,
maxSize: new go.Size(40, 40),
wrap: go.TextBlock.WrapFit,
textAlign: "center",
editable: false
},
new go.Binding("text", "text"))
));
myPalette.model.nodeDataArray = [
{name: "Lane", text: "Lane", isGroup: true, color:"#C0C0C0", },
{key:"Node", name: "Node", text: "Node", isGroup: false, color:"#00A9C9"},
];
This works in terms of functionality, the first node allows me drop in Lanes, the second entry allows nodes into the Lanes (using the Shift function).
The issue is however, the palette diagram - the first entry doesn't appear correctly, it appears with the text 'Lane' and below it a small square. The second entry in the palette appears correctly (40x40 Rounded Rectangle with the text 'Node' in the middle).
If I change the Lane data so isGroup is false I get the right appearance in the Palette but the functionality is wrong.
Not sure why all entries in the Palette wouldn't appear the same as I though the Palette would only get its data from myPalette variable.
Possibly the lane entry diagram entry in the Palette is being overridden by something else?
Or I don't have the NodeDataEntry correct?
Thanks,
Z