Displaying a button conditionally

Hi

Is there a way I can use a button in a node template, such that it is shown only when a certain condition is fulfilled? Maybe by defining and calling a function that returns a boolean?

Thanks in advance.

As a follow up, I found out how to use the visible property to set the buttons visibility, however, is there a way I can set the visibility of a node depending on whether the node has a parent or not?

Implement Node | GoJS API and Node | GoJS API event handlers. You can call Node | GoJS API to see if there is a link to a tree parent node.