HTML node change not show in diagram.saveDiagram

Hi,

My node in diagram is HTML type, when I click a button, changed the node background, the node bg color is changed, no problem.

But when I call the "diagram.saveDiagram", the node shap content background color is old, not change in value.


 {
    content:'<div style="background:#6BA5D7;height:100%;width:100%;"><button type="button" style="width:100px"> Button</button></div>',
    type:'HTML'
};

2 Replies

LO lorryl June 9, 2022 08:43 AM UTC

I see. It can be work by changing this.diagram.selectedItems.nodes[0].shape["content"]. 

I only change the html element color not work.



AR Aravind Ravi Syncfusion Team June 9, 2022 12:01 PM UTC

Hi Lorryl,


On analyzing the provided code snippet, you changed the background color of the HTML element, and while saving and loading you want to preserve the HTML element background color. By default, in the diagram, we have serialization support only for diagram properties. We do not have serialization support for the HTML element. Because HTML node is a HTML element we do not have property binding or serialization support for the HTML element.


Regards

Aravind Ravi


Loader.
Up arrow icon