Unable to update node

I'm using node templates to create my diagram nodes below. The visual states of nodes (eg. description) do not update even though the nodes of my diagram instance has been updated. Is there a function to update the node properties from code?

function diagramTemplate(props) {


if (props.id === "HTMLNode1") {
return (
<table>
<tbody>
<tr>
<td className="c1">{props.addInfo.description}</td>
<td className="c1">{props.addInfo.description}</td>
</tr>
<tr>
<td className="c1">{props.addInfo.description}</td>
<td className="c1">{props.addInfo.description}</td>
</tr>
</tbody>
</table>
)
}

3 Replies 1 reply marked as answer

AR Aravind Ravi Syncfusion Team October 7, 2020 01:50 PM UTC

Hi Jasmine, 
 
Could you please confirm us, that you want to update the value in node addInfo property when you change the value in HTML table content. If yes, then by default , in the diagram, we have only property change support for the diagram properties. We do not have property change support for the private and HTML properties. So if you change any value in HTML content means then that value does not gets reflected in the node addInfo property. However, get the HTML element from the DOM and read those table values and assign those values to the node addInfo description values. So that node addInfo value gets same as HTML content value. 
 
Regards 
Aravind Ravi 



JT Jasmine Tay October 7, 2020 03:20 PM UTC

Hi Aravind,

I would like to update the addInfo properties in the DOM but the change is not reflected in the HTML content. For eg, after updating addInfo.description of a node in the code, it does not display the change in the HTML content.



AR Aravind Ravi Syncfusion Team October 9, 2020 03:38 AM UTC

Hi Jasmine,  
  
As we said earlier, in the diagram, we have only property change support for the diagram properties. We do not have property change support for the private and HTML properties. So if you change any value in HTML content means then that value does not gets reflected in the node addInfo property . Similarly , if we change the node’s addInfo description means then new addInfo value does not gets reflected in the HTML table content values. However, get the HTML element from the DOM and after change the node addInfo value, assign those values to the HTML table values. So that HTML content value gets update as same as node addInfo description. 
  
Regards  
Aravind Ravi  
 


Marked as answer
Loader.
Up arrow icon