Hi,
I’m trying to start a link from a panel title but when the mouse is over the textblock the event is not fired. In few words…Is possible to put the textblock in a different layer than the shape with ports, leaving the text visible? Or making the panel start linking when then mouse is clicking over textblock ?
Here’s my code:
myDiagram.nodeTemplateMap.add("Drivers",
$(go.Node, "Auto",
{
isTreeExpanded: true,
minLocation: new go.Point(NaN, NaN), // not allow movement
maxLocation: new go.Point(NaN, NaN),
deletable: false
},
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
// this rectangular shape surrounds the content of the node
{
contextMenu: myContextMenu
},
$(go.Shape,
{ fill: "#EEEEEE" }),
// the content consists of a header and a list of items
$(go.Panel, "Vertical",
// this is the header for the whole node
$(go.Panel, "Auto",
{ stretch: go.GraphObject.Horizontal }, // as wide as the whole node
$(go.Shape,
{
fill: "#AF5555",
stroke: null,
minSize: new go.Size(150, 10),
portId: "totale",
background: "transparent",
// allows links to/from all sides
fromSpot: go.Spot.Right,
toSpot: go.Spot.Left,
// allows drawing links from or to this port
fromLinkable: true,
toLinkable: true,
cursor:"pointer",
mouseEnter: function(e, port) { // the PORT argument will be this Shape
if (!e.diagram.isReadOnly) port.fill = "#FF0000";
},
mouseLeave: function(e, port) {
port.fill = "#AF5555";
}
}
),
$(go.Picture,
{ source: imgpth+"enter_class.png",
column: 0,
background: "transparent",
width: 20,
height: 20,
alignment: go.Spot.TopLeft
}),
$(go.TextBlock,
{
alignment: go.Spot.Center,
column: 1,
margin: new go.Margin(3, 5, 3, 10),
stroke: "white",
textAlign: "center",
font: "bold 10pt sans-serif"
},
new go.Binding("text", "cname")
),
$("PanelExpanderButton", "TABLE",
{
column: 2,
alignment: go.Spot.TopRight
})
),
/*
{ // handle mouse enter/leave events to show/hide the ports
mouseEnter: function(e: go.InputEvent, node: go.GraphObject) { showSmallPorts(node: go.GraphObject, true); },
mouseLeave: function(e: go.InputEvent, node: go.GraphObject) { showSmallPorts(node: go.GraphObject, false); }
},
*/
// this Panel holds a Panel for each item object in the itemArray;
// each item Panel is defined by the itemTemplate to be a TableRow in this Table
$(go.Panel, "Table",
{
name: "TABLE",
padding: 2,
minSize: new go.Size(140, 10),
defaultStretch: go.GraphObject.Horizontal,
itemTemplate: fieldTemplate,
visible: false,
cursor:"pointer"
},
new go.Binding("itemArray", "fields")
) // end Table Panel of items
) // end Vertical Panel
)); // end Node
>>>
here's the image:
![immagine|690x288](upload://cQl2cLXKBtTGU017FLpVSS38aEe.png)
Thx