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

Hide or show node element with button onclick

$
0
0

@brianc wrote:

Hi all,

As the title stated above,

  1. I have set the element’s visible to false:

         ...
         $(go.Panel, "Table", { name: "SCORE", visible: false },
          ...
         )
    
  2. I have created show and hide buttons:

         $("Button",
           { row: 4, 
             margin: 2,
             click: function(e, node) { node.findObject("SCORE").visible = "true"; },
             maxSize: new go.Size(115, 28)
           },
           $(go.TextBlock, "Show Score")
         ), //end row 4
         $("Button",
           { row: 5, 
             margin: 2,
             click: function(e, node) { node.findObject("SCORE").visible = "false"; },
             maxSize: new go.Size(115, 28)
           },
           $(go.TextBlock, "Hide Score"))
    

but I got an error stating “Uncaught TypeError: Cannot set property ‘visible’ of null”. I have no idea how to solve the error. Please help.

Thank you.

Brian

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles