Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic While reloading the diagram without refreshing the page Events.linkDeleting in not working (Read 4871 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
While reloading the diagram without refreshing the page Events.linkDeleting in not working
Sep 27th, 2017 at 10:56am
Print Post  
I am creating diagram component for first time Link Delete event works properly. Now my problem is that when ever i am drawing the diagram again using the same component instance it draws perfectly no problem but now if i want delete the link it does not work.

Can you please let me know where I am going wrong. Do I need to call any other API which before drawing the diagram again?

Thanks
Ankur Shah
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #1 - Sep 27th, 2017 at 11:09am
Print Post  
Are you pressing Del key, it deletes selected links, but does not raise the event?

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #2 - Sep 27th, 2017 at 11:24am
Print Post  
Yes I am pressing delete key. It does not delete link as well as not raising any event.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #3 - Sep 27th, 2017 at 11:29am
Print Post  
And what do you mean by 'drawing the diagram again'? Clearing and rebuilding it from code?
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #4 - Sep 27th, 2017 at 11:36am
Print Post  
Actually i am Working on Angular and have created the component. I have constructed the component instance only once and provided the data when ever anything change in data. Diagram get drawn properly but facing problem when we want to delete the link.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #5 - Sep 27th, 2017 at 11:55am
Print Post  
Okay, so what Diagram methods get called by your function that receives new data?
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #6 - Sep 27th, 2017 at 12:00pm
Print Post  
When ever any data gets changed below method will get called.
Code (Javascript)
Select All
set dataSource(value) {
        // create a Diagram component that wraps the 'diagram' canvas
        if (value !== undefined && value !== null) {
            this.diagramModel = value;

            this.diagram = Diagram.create(document.querySelector('#diagram'));
            this.diagram.clearAll();
            this.diagram.setBehavior(MindFusion.Diagramming.Behavior.DoNothing);
            this.diagram.setAutoResize(MindFusion.Diagramming.AutoResize.AllDirections);
            this.diagram.setEnabled(false);
            this.prepareTreeGraph(this.diagramModel.containerNodes, this.diagramModel.links, this.diagramModel.attributes);
        }
    }
 


Can you please let me know is there any api for initializing diagram?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: While reloading the diagram without refreshing the page Events.linkDeleting in not working
Reply #7 - Sep 28th, 2017 at 7:39am
Print Post  
Diagram.create creates a new Diagram instance, and you might be left with several Diagram objects bound to same Canvas element, which could have some effect on keyboard focus handling. Try moving Diagram.create into an 'if (this.diagram == null) {}' block to see if it helps.

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