Hover on Node (Dynamic Text)

Hi, we'd like to implement a feature where we display a tooltip when we hover over a node.

The tooltip seems to fit this description, but we're struggling to update the text within the tooltip (as we need to make a call to a webservice to obtain the text to display in the tooltip).

Do you have a sample anywhere?

1 Reply

SG Shyam G Syncfusion Team March 19, 2020 07:08 AM UTC

Hi Nick, 

We have created a sample in which we have updated the node tooltip text dynamically by clicking on the updateTooltip button. Similarly, you can set the tooltip text to the node dynamically by retrieving it from the webservice. Please refer to a code example and the sample below. 

Code example: 
   function updateTooltip() { 
     var diagram = document.getElementById("diagram").ej2_instances[0]; 
     if(diagram.nodes.length > 0) { 
       //iterate a node 
       for(var i=0; i < diagram.nodes.length; i++) { 
         var node = diagram.nodes[i]; 
         //set a tooltip content for each node 
         node.tooltip.content = "TooltipData"; 
         diagram.dataBind(); 
      
    
   }  



Regards, 
Shyam G 


Loader.
Up arrow icon