Closed Yusufzai closed 3 years ago
Hello @Yusufzai
Use attributes df- for save data. https://github.com/jerosoler/Drawflow#nodes
The modal append in drawflow div. No in body.
Or use updateNodeDataFromId
method for update data manualy.
View in demo "DbClick!" node.
Jero
Thanks for the reply @jerosoler
I think my question is not clear to you
Let me clarify my query.
I have a widget that uses the df-* attribute.
I entered a value in that widget. Screenshot ->
Now I clicked on "Show JSON data" ( A button created by me but using the same functionality as in your export button and also I have changed the modal using code mirror )
So the output value of exported JSON data is ->
Now If I edit inside the JSON data directly from the modal like ->
How can I save this and output it to my widget on save btn click ->
Note 1 - : . I am already using df- * attribute Note 2 - : I am not asking about DBclick example.
Hope this time I am clear to you :)
uhmmm. Okay.
Use updateNodeDataFromId
But I see that more than one node can be edited. Import the new Json on Save for regenerate flow.
Yes, More than one code can be edited. How can I Import the new Json on Save for regenerate flow as this is exactly I want?
I got this inside the docs https://github.com/jerosoler/Drawflow#export--import
I can I use that any idea!
Yes simple!
editor.import(YOUR_DATA);
If you use modules. Save the module name and. To be at the same point.
editor.changeModule('nameofmodule');
The import data should be the JSON data right?
editor.import(MY_JSON_DATA);
Yes! View example: https://github.com/jerosoler/drawflow-minimap-example/blob/main/index.html
It works successfully. Thanks for the help :)
How can I JSON save data when I edit it on modal.
For Example :
I have this -> https://prnt.sc/18xbkn5
Now I have updated my data like -> https://prnt.sc/18xbuok
and I want to save the data in my workflow
How can I save it?