0

I tried a lot but was unable to find a solution. Please help me as I am struck on this issue for more than 1 day. Any help would be really appreciated.

I have a Syncfusion application that has been developed using Angular, now I would like to convert that application into Vuejs so trying to convert it but I am facing lot of issue as I am unable to find the 1:1 mapping of the ejsdiagram methods.

In Angular I was using the following code and respective method:

<ej-diagram id="diagram" e-height="80vh" e-width="100%" e-nodeCollectionChange="nodeCollectionChange" e-connectorCollectionChange="connectorCollectionChange" e-connectorTargetChange="connectorTargetChange" e-connectorSourceChange="connectorSourceChange" e-textChange="textChange"></ej-diagram>

Now I am using something like this in Vuejs:


<div id="app">
            <ejs-diagram
              id="diagram"
              ref="diagramObj"
              :width="width"
              :height="height"
              :collection-change="collectionChange"
              :e-connector-collection-change="connectorCollectionChange"
            />
          div>

I would like to know the Vuejs equivalent function for e-connectorCollectionChange, e-connectorTargetChange, etc, I searched a lot but could not find any documentation or maybe I missed something. Can someone please guide me through this?

Basically, I want to have something like this in my Vuejs+Syncfusion application. I have it in Angular+Syncfusion:

enter image description here

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
  • Did you checked this part of the documentation? https://ej2.syncfusion.com/vue/documentation/diagram/connectors/ – kissu Oct 13 '21 at 10:11
  • @kissu Thanks for your response. Yes, I have checked and following the same. Actually, they have not mentioned these things over there it just gives a brief overview of everything. I am unable to find these things over there. – BATMAN_2008 Oct 13 '21 at 10:24

1 Answers1

1

We have added the sample link to demonstrate how to add connector collection change and connector target change in the diagram. Instead of using connector collection change, we can use the collection change event which will be triggered when a new node or connector gets added to the diagram. Using the element argument in collection changed event args, we can able to find whether connector or node gets added to the diagram. For more information, please refer to the following documentation and the code snippet below.

<ejs-diagram style='display:block' 
  ref="diagramObject"
  id="diagram"
  :width='width'
  :height='height'
  :nodes='nodes'
  :connectors='connectors'
  :getNodeDefaults='getNodeDefaults' 
  :getConnectorDefaults='getConnectorDefaults' 
  :collectionChange="collectionChange" 
  :sourcePointChange="sourcePointChange" 
  :targetPointChange="targetPointChange"
  :textEdit="textEdit">
</ejs-diagram>

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Events16960811600180

Documentation Link: https://ej2.syncfusion.com/vue/documentation/diagram/getting-started/

Sample Browser Link: https://ej2.syncfusion.com/vue/demos/#/bootstrap5/diagram/diagram-events.html

kissu
  • 40,416
  • 14
  • 65
  • 133