Double Click / F2 Action

  1. I would like to edit the node (run a JS function) when a node is double clicked. 
  2. I would also like to edit the node (run a JS function) when the F2 button is pressed and a node is selected.

Are either of these actions possible?

1 Reply 1 reply marked as answer

AR Aravind Ravi Syncfusion Team August 21, 2020 04:39 AM UTC

Hi Dsoftware, 

Soultion 1:  

By default, in the diagram, when you double click on the node, text edit box gets appears and you can able to edit the text in the node.  

Solution 2: 

When you double click on the node, doubleClick event gets triggered. In that event get the node from the selection list and by using the startLabelEdit method we can able to edit the text. Please refer to below code snippet for how to use startLabelEdit method. 

var diagram = $("#DiagramContent").ejDiagram("instance"); 
        var node = diagram.selectionList[0]; 
        diagram.startLabelEdit(node, node.labels[0]); 

Regards 
Aravind Ravi 


Marked as answer
Loader.
Up arrow icon