Hi Walter,
I understand that Panel inherit GraphicObject. I have a situation where I need to handle the click event on each of the segment. But somehow the click event is never getting fired in the template example given.
Am I missing out something? Could you please help me out?
var HighlighterTemplate =
$(go.Adornment, "Spot",
$(go.Placeholder), // takes the size and position of the adorned Node
$(go.Panel,
new go.Binding("itemArray", "colors"),
{
itemTemplate:
$(go.Panel, // this Panel.itemIndex will tell us which item it is in the colors Array
{
click : function(e,obj) {debugger;}
},
$(go.Shape, { strokeWidth: 0.5, stroke: "gray" },
new go.Binding("fill", ""), // the item will be the CSS color string
new go.Binding("geometry", "", function(color, shape) { // compute the Geometry
// ignore the color
var colorarr = shape.panel.panel.itemArray;
var sweep = 180/colorarr.length; // cannot be zero, else there wouldn't be any item Panel
var i = shape.panel.itemIndex; // the index of the color in the colors Array
var b = shape.part.adornedPart.actualBounds; // the adorned Node's bounds
var radius = Math.sqrt(b.width*b.width/4 + b.height*b.height/4) + 12;
return makeAnnularWedge(180 + i * sweep, sweep, radius);
})))
})
);