Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method (Read 921 times)
NoBugNoCode
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 18th, 2023
Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method
Apr 23rd, 2023 at 9:02pm
Print Post  
Dear MindFusion Team,

I am facing an issue with the SaveToString method while attempting to save the selected option values of a node in a tree diagram. The nodes and their connections are being saved without any problems and can be rendered back into the tree. However, I am unable to retrieve the values of the select options from the saved instance of the diagram when using the SaveToString method.

Thank you in advance for your assistance.

//here is a snippet of the code:
Code (Javascript)
Select All
 let diagramString = this.diagram.saveToString();
...
  this.diagram.loadFromString(diagramString );
 


Best regards
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method
Reply #1 - Apr 24th, 2023 at 7:43am
Print Post  
Hi,

What do you mean by selected options?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
NoBugNoCode
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 18th, 2023
Re: Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method
Reply #2 - Apr 24th, 2023 at 8:29am
Print Post  
The node of the tree uses an HTML template, which contains both text content and a select option input that leads to subsequent nodes. One thing to note is that I am able to retrieve the tree diagram perfectly from diagramString using the built-in MindFusion method. However, it does not automatically select the options that were previously selected. To provide more clarity, here is a snippet of the tree template code:

Code (HTML)
Select All
...
<!-- This is the select option I am referring to -->
<select style='width: 100px;' data-interactive="true" data-event-change="selectClick" name= "${id}" class="select" id= "${id}">
                            <option value="none" selected> ...</option>`;
 


Thanks!
  

Screenshot_2023-04-24_125402.png ( 9 KB | 37 Downloads )
Screenshot_2023-04-24_125402.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method
Reply #3 - Apr 24th, 2023 at 9:07am
Print Post  
ControlNode does not save embedded HTML values out of the box. You could handle the option's HTML events and assign the selected value to node's id or tag to save them automatically, and later restore them from nodeDomCreated event. This is shown for checkbox values in Samples/JavaScript/ControlNodes.js example from distribution.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
NoBugNoCode
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 18th, 2023
Re: Issue with Saving Selected Options of a Node in Tree Diagram using SaveToString Method
Reply #4 - Apr 26th, 2023 at 8:37am
Print Post  
Thank you so much!! It is working now
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint