Thanks,
I have done the table template with the table panel with 2 columns and it’s working.
var tableTemplate =
$$(go.Node, “Auto”,
{
movable: true,
copyable: false,
deletable: false,
resizable: true,
defaultStretch: go.GraphObject.Fill,
background: “transparent”,
locationSpot: new go.Spot(0, 0, cellSize.width / 2, cellSize.height / 2),
minSize: groupSize,
},
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
// this rectangular shape surrounds the content of the node
$$(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.Fill }, // as wide as the whole node
$$(go.Shape,
{ fill: “#1570A6”, stroke: null }),
$$(go.TextBlock,
{
alignment: go.Spot.Center,
margin: 3,
stroke: “white”,
textAlign: “center”,
font: “bold 12pt sans-serif”
},
new go.Binding(“text”, “key”))),
// 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: 0,
//minSize: tableSize,
defaultStretch: go.GraphObject.Fill,
defaultRowSeparatorStroke: “black”,
defaultColumnSeparatorStroke: “black”,
//itemTemplate: fieldTemplate
},
$$(go.RowColumnDefinition, { row: 1, height: 50 }),
//Define the Column for headers
$$(go.Panel, "TableRow", { row: 0 },
$$(go.TextBlock, "Header",
{ column: 0, height: 25, width: 100,font: "bold 10pt sans-serif", margin: 0 }),
$$(go.TextBlock, "Content",
{ column: 1, height: 25, width: 100, font: "bold 10pt sans-serif", margin: 0 })),
$$(go.Panel, "TableRow", { row: 1},
////////////////////
//HEADER
//////////////////////
$$(go.Panel, "Vertical",
{ column: 0 }
),
////////////////////
//CONTENT
//////////////////////
$$(go.Panel, "Vertical",
{ column: 1 }
)
),
$$(go.RowColumnDefinition, { row: 0, separatorStrokeWidth: 1.5, separatorStroke: "black" }),
$$(go.RowColumnDefinition, { column: 1, separatorStrokeWidth: 1.5, separatorStroke: "black" })
) // end Table Panel of items
) // end Vertical Panel
); // end Node
Now I have to drag fields from the palette and also from the diagram and drop them into one column of the table (header or content). For this purpose I created a custom dragging tool class and assigned to the diagram, overriding the same method as in the Regrouping Demo (findDraggablePart, doActivate, doDeactivate, doMouseMove, doMouseUp). In this case the dragging tool is called only when I drag from inside the diagram and not from the palette. How can I drag nodes directly from the palette into the table?
Many thaks for your precious help.
Andre