Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) edited form of diagram (Read 11363 times)
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
edited form of diagram
May 14th, 2019 at 6:53am
Print Post  
How can I regenerate my diagram in edited form and after updating it it shold save in database, and load from the database.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #1 - May 14th, 2019 at 7:54am
Print Post  
Hi,

Did you check the Network sample as suggested in another thread? It shows exactly how to save/load the diagram from file/JSON.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #2 - May 14th, 2019 at 8:18am
Print Post  
Hey Lyubo,
I am loading data from database using Json. I need to load diagram in the edited form.So that I can edit it and save.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #3 - May 14th, 2019 at 10:02am
Print Post  
That's exactly what the Network sample shows - you can load data form JSON or XML, edit the diagram in the browser, than save the edited data again.
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #4 - May 14th, 2019 at 11:00am
Print Post  
Please share once again the code.

also used diagram.setAllowInplaceEdit(true); but with this I am not able to get the node text in createnodeevent so I am not able to saving it to database.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #5 - May 14th, 2019 at 11:31am
Print Post  
Hi,

Which code do you need? The Network sample application can be found in the installed location of the MvcDiagram Package - we provide MVC4 and MVC5 examples for both C# and VB.NET.

When using AllowInplaceEdit and you want to detect changes made by the user, you can either handle the NodeTextEditedScript event on the server-side, or the client-side equivalent: leaveInplaceEditMode.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #6 - May 15th, 2019 at 4:15am
Print Post  
When I set  AllowInplaceEdit to true, I can edit the loaded diagram from database but not able to fire any of the event on editing its text etc... and also getting error  diagram_lic.txt not found.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #7 - May 15th, 2019 at 5:35am
Print Post  
Hi,

InplaceEdit events work correctly in my test. Working with the Network sample, I've only added this to the controller's Index method:
Code
Select All
view.AllowInplaceEdit = true;
view.NodeTextEditedScript("onNodeTextEdited"); 

and the following in Index.cshtml:
Code
Select All
function onNodeTextEdited(sender, args) {
    alert(args.getNewText());
} 


An alert with the new text will show every time a node text is edited.

Are you getting the 404 error in a MVC application with the scripts and assemblies provided with the MvcDiagram package?

Regards,
Lyubo
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #8 - May 15th, 2019 at 5:59am
Print Post  
Lyubo wrote on May 15th, 2019 at 5:35am:
Hi,

InplaceEdit events work correctly in my test. Working with the Network sample, I've only added this to the controller's Index method:
Code
Select All
view.AllowInplaceEdit = true;
view.NodeTextEditedScript("onNodeTextEdited"); 

and the following in Index.cshtml:
Code
Select All
function onNodeTextEdited(sender, args) {
    alert(args.getNewText());
} 


An alert with the new text will show every time a node text is edited.

Are you getting the 404 error in a MVC application with the scripts and assemblies provided with the MvcDiagram package?

Regards,
Lyubo



Hi,
This is my js code
diagram = Diagram.create($("#testid")[0]);   
    diagram.setAllowInplaceEdit(true);


now when I edited the node no any event is fired and in console getting the following error: Failed to load resource: the server responded with a status of 404 (Not Found)
:64125/FlowChart/diagram_lic.txt:1
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #9 - May 15th, 2019 at 6:02am
Print Post  
Are you using MVC and MvcDiagram or do you use the standalone JavaScript Diagramming package? The code example above is meant to work in a MVC application, where the DiagramView is created server-side, and you don't create a diagram on the client-side.
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #10 - May 15th, 2019 at 6:40am
Print Post  
Hi, No I am using Mindfusion Diagramming for MVC. Created diagram from client side.
  
Back to top
AIM  
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #11 - May 15th, 2019 at 6:41am
Print Post  
It worked for me thanks. Can you please tell me how to get the id of the node in the same method?

liza wrote on May 15th, 2019 at 5:59am:
[quote author=57626E79741B0 link=1557816827/7#7 date=1557898515]Hi,

InplaceEdit events work correctly in my test. Working with the Network sample, I've only added this to the controller's Index method:
Code
Select All
view.AllowInplaceEdit = true;
view.NodeTextEditedScript("onNodeTextEdited"); 

and the following in Index.cshtml:
Code
Select All
function onNodeTextEdited(sender, args) {
    alert(args.getNewText());
} 


An alert with the new text will show every time a node text is edited.

Are you getting the 404 error in a MVC application with the scripts and assemblies provided with the MvcDiagram package?

Regards,
Lyubo


  
Back to top
AIM  
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #12 - May 15th, 2019 at 6:46am
Print Post  
It worked for me, can You please let me know how can I get id of edited node? I tried args.node.id but getting undefined
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: edited form of diagram
Reply #13 - May 15th, 2019 at 6:59am
Print Post  
Code (Javascript)
Select All
args.getNode().getId() 

But it will be undefined, as it doesn't have a default value. You need to have set the id yourself.
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: edited form of diagram
Reply #14 - May 15th, 2019 at 7:56am
Print Post  
Hi, Please can you tell me how can I resolve the folowing error which I receiving in console now while doing any edition in base canvas (creating node, link..etc)

Failed to load resource: the server responded with a status of 404 (Not Found) for
:64125/FlowChart/diagram_lic.txt
  
Back to top
AIM  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint