Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic saveToString throws Cannot read properties of undefined (reading 'toString') (Read 708 times)
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
saveToString throws Cannot read properties of undefined (reading 'toString')
Mar 15th, 2023 at 9:43pm
Print Post  
Hi there,

When I am trying to save data in serialized string format in JSON format like this:

Code (Javascript)
Select All
var stringDiagramData = diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Json); 



then it works great.

But if I chose XML format like this :

Code (Javascript)
Select All
var stringDiagramData = diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml); 


then it throws me following error:
VM254:1 Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
at _0x26331b.writeInt (<anonymous>:1:442651)
at _0xae98a.saveToXml (<anonymous>:1:1088382)
at _0x26331b.saveItemToXml (<anonymous>:1:423518)
at _0x15f44e.toXmlDocument (<anonymous>:1:546212)
at _0x15f44e.saveToString (<anonymous>:1:543675)
at eval (eval at WFDiagramArea.createShape (custom.js?v=aaf929a5-d26f-4495-95a6-a512bbb6d8bc:1:1), <anonymous>:1:9)
at WFDiagramArea.createShape (custom.js?v=aaf929a5-d26f-4495-95a6-a512bbb6d8bc:31024:16)
at WFDiagramArea.contextMenuActions (custom.js?v=aaf929a5-d26f-4495-95a6-a512bbb6d8bc:30611:18)
at S.fn.init.callback (custom.js?v=aaf929a5-d26f-4495-95a6-a512bbb6d8bc:30430:18)
at HTMLLIElement.itemClick (<anonymous>:900:30)



I will be very thankful if someone help me with this problem, thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: saveToString throws Cannot read properties of undefined (reading 'toString')
Reply #1 - Mar 16th, 2023 at 1:01pm
Print Post  
Hi,

Try new scripts here -
https://mindfusion.eu/_patch/jsdiag_xml_dash.zip

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


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Re: saveToString throws Cannot read properties of undefined (reading 'toString')
Reply #2 - Mar 16th, 2023 at 1:55pm
Print Post  
Perfect it works thanks!

Also I have one more concern? When I am trying to drag item they are not in sync therefore it is difficult to drag items, as shown in the attached pics.


Also when I hover mouse over the diagram node or path, they are out of sync, you can see in attached pic the resize arrow is out of sync.

Thanks
  

DragProblemWith.png ( 29 KB | 36 Downloads )
DragProblemWith.png
ResizeIssue.png ( 16 KB | 36 Downloads )
ResizeIssue.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: saveToString throws Cannot read properties of undefined (reading 'toString')
Reply #3 - Mar 16th, 2023 at 4:05pm
Print Post  
Are those custom mouse cursors, or some magnification effect of your screenshot app? If using custom cursors, make sure you haven't assigned wrong images. Otherwise please attach a minimal sample reproducing that.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint