Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Add TableRow in the table

$
0
0

@ndieng wrote:

Hi want to add table rowin my table this the code
//add field decision or question
myDiagram.nodeTemplateMap.add(“Decision”,
(go.Node, "Auto",nodeStyle(), (go.Shape, { fill: “white”, stroke: “gray”, strokeWidth: 3 }),
(go.Panel, "Table", // Set defaults for all rows and columns: { defaultRowSeparatorStroke: "gray", defaultColumnSeparatorStroke: "gray" }, (go.Panel, “TableRow”, { row: 0 },
(go.TextBlock, "Header 1", { column: 1, font: "bold 10pt sans-serif", margin: 2 }), (go.TextBlock, “Header 2”,
{ column: 2, font: “bold 10pt sans-serif”, margin: 2 })),
(go.RowColumnDefinition, { row: 1, separatorStrokeWidth: 1.5, separatorStroke: "black" }), (go.RowColumnDefinition,
{ column: 1, separatorStrokeWidth: 1.5, separatorStroke: “black” }),
(go.Panel, "TableRow", { row: 1 }, (go.TextBlock, “One”, { column: 0, stroke: “green”, margin: 2 }),
(go.TextBlock, "Male", { column: 1, margin: 2,editable: true }), // (go.TextBlock, “row 1 col 2”, { column: 2, margin: 2 } )
(go.Panel, "Vertical", {column: 2, margin: 2}, (“Button”,
{
margin: 2,
click: showSecondInspector },
$(go.TextBlock, “Set”)
)

                        )
                    ),
                    $(go.Panel, "TableRow", { row: 2 },
                        $(go.TextBlock, "Two", { column: 0, stroke: "green", margin: 2 }),
                        $(go.TextBlock, "Female", { column: 1, margin: 2  , editable: true}),
                      //  $(go.TextBlock, "row 2 col 2", { column: 2, margin: 2 })
                        $(go.Panel, "Vertical",
                            {column: 2, margin: 2},
                            $("Button",
                                {
                                    margin: 2,
                                    click: showSecondInspector },
                                $(go.TextBlock, "Set")
                            )

                        )
                    ),
                    $(go.Panel, "TableRow", { row: 3 },
                        $(go.TextBlock, "Three", { column: 0, stroke: "green", margin: 2 ,}),
                        $(go.TextBlock, "Other", { column: 1, margin: 2 ,editable: true }),
                        //$(go.TextBlock, "row 3 col 2", { column: 2, margin: 2 })
                        $(go.Panel, "Vertical",
                            {column: 2, margin: 2},
                            $("Button",
                                {
                                    margin: 2,
                                    click: showSecondInspector },
                                    $(go.TextBlock, "Set")
                            )

                        )
                    )
                ),
                new go.Binding("text", "text").makeTwoWay()
            ));

I want to create one button and if i click there i add dynamycally a table row .
Thanks

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles