Double click on node object


#1

Hi,

On double-click of a node, I want to launch a properties window in a light box. Please could you give me some direction on how to achieve this.

Thanks In Advance,

Ian.


How to implement palette click event
Palette Click Event
#2

To get the double-click event, set the GraphObject.doubleClick property on your Node (template) to a function. There are several examples in the samples, such as http://gojs.net/latest/samples/classHierarchy.html and http://gojs.net/latest/samples/orgChartEditor.html:

  myDiagram.nodeTemplate =
    $(go.Node, . . .,
        {
          doubleClick: function(e, node) {
            // . . . now node is the Node that was double-clicked
            var data = node.data;
            // now data has all of the custom app-specific properties that you have
            // supplied for that node, in the Model.nodeDataArray
            . . .
          }
        },
        . . .);

In the doubleClick event handler you can use obj.data to get the model data for the node. Then you can use whatever your framework supports, or just plain HTML, to show the properties you want.