jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.65k stars 722 forks source link

Get export code with inputs #468

Closed shashinthalk closed 2 years ago

shashinthalk commented 2 years ago

I have tested your demo, But if I change GitHub starts node input value, the export option doesn't include that changed text. How can I solve this issue? Is there any way to get updated JSON?

jerosoler commented 2 years ago

The change appears in the "data" of the node. Not in the html of the node, that html is not modified.

image

The data you want to modify from inputs, textareareas, selects. You can use the df-* attributes https://github.com/jerosoler/Drawflow#node-example

var html = `
<div><input type="text" df-name></div>
`;
var data = { "name": '' };

editor.addNode('github', 0, 1, 150, 300, 'github', data, html);

df-name it updates automatically.

shashinthalk commented 2 years ago

Thank you