Additionally, I also need the drop event fired if I click on the "clone" icon when a node is selected.
As usual, your advice appreciated.
Thanks in advance
Jim
Hi Jim
Thanks for using Syncfusion products.
Please note that “drop” event triggered when the node is dropped inside the diagram area(canvas). We suggest you to use “NodeCollectionChange” event to achieve your requirement and this event triggered when we click the item in the palette and also when we click the “clone” handles, when a node is selected. We have attached sample below. Please see the code snippet below.
Here is the code snippet
<ej:Diagram ID="DiagramContent" runat="server" Height="100%" Width="100%">
</ej:Diagram>
DiagramContent.OnClientNodeCollectionChange
= "NodeCollectionChanged";
function NodeCollectionChanged(args) {
}
Please let me know if any concerns.
Regards,
Shyam G
Hi Jim
Thanks for the update.
Please note that if you are using a Diagram builder application, We have already triggered a “nodeCollectionChange” event on client side in the “diagrambuilder.js” file. If you trigger a “nodeCollectionChange” event in server side in the same Diagram builder application then the “nodeCollectionChange” event will not be triggered. So we suggest you to remove the client side “nodeCollectionChange” event of “diagram.model.nodeCollectionChange = nodecollectionchanged;” in the “diagrambuilder.js” file and use the server side “nodeCollectionChange” event. Please see the code snippet below to use the server side “nodeCollectionChange” event.
Here is the code snippet
DiagramContent.OnClientNodeCollectionChange
= "NodeCollectionChanged";
function NodeCollectionChanged(args) {
}
We have attached sample below for your reference.
Please let me know if any concerns.
Regards,
Shyam G
In all cases the nodeCollectionChange event fires, but the "changetype" is always undefined.
What I am trying to do is drag one shape from the palette and when it is dropped, have another shape appear.
You'll see this happen for operation #3 - after the nodeCollectionChange event fires.
But I want the same thing to occur for the other 2 operations.
In my event handler for the nodeCollectionChange event, I'm calling the drop event handler.
Here's the code:
function dropHandler(args) {
if (args.element) {
if (!args.element.isSwimlane) {
var node = args.element;
if (node.addInfo.ContentId) {
var svg = document.getElementById(node.addInfo.ContentId);
if (node.addInfo.DropWidth) {
node.width = node.addInfo.DropWidth;
node.height = node.addInfo.DropHeight;
} else {
node.width = 120;
node.height = 60;
}
diagram.updateNode(node.name, { shape: { content: svg, type: "native" } });
}
}
}
}
function NodeCollectionChange_Handler(args) {
alert('In NodeCollectionChange - name = ' + args.element.name + ' changetype = ' + args.changetype);
dropHandler(args);
}
How can I achieve the same end result for operations 1 & 2 as I do for 3?
Thanks
Jim
Hi Jim
Thanks for the update.
Query |
Response |
I'm
performing 3 operations in this video in this order:
In all cases the nodeCollectionChange event fires, but
the "changetype" is always undefined. |
We suggest you to set “changetype” as “changeType”
to resolve your issue. We have modified your code and provided below function nodecollectionchange(args) {
alert('In NodeCollectionChange - name = ' + args.element.name + ' changetype = ' + args.changeType); } |
What I am trying to do is drag one shape from the
palette and when it is dropped, have another shape appear. You'll see this happen for operation #3 - after the
nodeCollectionChange event fires. But I want the same thing to occur for the other 2
operations. In my event handler for the nodeCollectionChange event,
I'm calling the drop event handler. Here's the code: function dropHandler(args) { How can I achieve the same end result for operations 1
& 2 as I do for 3? |
We are analyzing on your requirement of rendering different
preview in the canvas when an item is click in the palette. We will update
you with more information in one business day. |
Please let me know if any concerns.
Regards,
Shyam G
Hi Jim
Thanks for your patience.
Query |
Response |
What I am trying to do is drag one
shape from the palette and when it is dropped, have another shape appear. You'll see this happen for operation
#3 - after the nodeCollectionChange event fires. But I want the same thing to occur
for the other 2 operations. In my event handler for the
nodeCollectionChange event, I'm calling the drop event handler. Here's the code: function dropHandler(args) { How can I achieve the same end
result for operations 1 & 2 as I do for 3?
|
We are glad to inform you that we
have created a sample to achieve your requirement of rendering different preview in the canvas using
“nodeCollectionChange” event. This
event triggers before the node gets added in the diagram. So you can give SVG
element in the “node.shape.content”.Please
see the code snippet below. We have attached sample below function nodecollectionchange(args)
{ if (args.element.shape) { var node = args.element; node.width = 100; if (node.addInfo.Id) { //gets the id of SVG element var svg = document.getElementById(node.addInfo.Id); var child = svg.lastElementChild.firstElementChild; child.setAttribute('transform', 'translate(-257.23333,-247.97111)'); node.shape.content = svg; node.shape.type = "native"; } } }
|
Please let me know if any concerns.
Regards,
Shyam G
Hi Jim
Thanks for the update.
We are glad to inform you that we have created a sample to achieve your requirement of rendering different preview in the canvas with path node. Please see the code snippet below which represents how to render path node in the “drop” event and “nodeCollectionChange” event. We have attached sample below.
nodeCollectionChange
function nodecollectionchange(args) {
if (args.element.shape) {
var node = args.element;
node.width = 100;
node.shape.pathData = "M114-0.25H6c-3.313,0-6,2.687-6,6v48c0,3.312,2.687,6,6,6h108c3.312,0,6-2.688,6-6v-48
C120,2.437,117.312-0.25,114-0.25z M23.186,5.917l-7.978,6.44L7.23,5.917H23.186z
M24,17H6.417V6.545l8.791,7.097L24,6.545V17z";
}
}
Drop
function drop(args) {
if (args.element) {
if (args.element.shape) {
var node = args.element;
node.width = 100;
diagram.updateNode(node.name, { shape: { pathData: "M114-0.25H6c-3.313,0-6,2.687-6,6v48c0,3.312,2.687,6,6,6h108c3.312,0,6-2.688,6-6v-48
C120,2.437,117.312-0.25,114-0.25z M23.186,5.917l-7.978,6.44L7.23,5.917H23.186z
M24,17H6.417V6.545l8.791,7.097L24,6.545V17z", type: "path" } });
}
}
}
Please let me know if any concerns.
Regards,
Shyam G
I don't know how, exactly, to "upgrade" the sample project to the latest version. It appears that I have version 16.2460.0.41 installed, but how do I get that into the sample project? What files do I need? Which files are not necessary? The references and folder structure between the sample project and a new project are vastly different. There is no upgrade wizard that I can find, and trying to do this manually has proven to be next to impossible.
|
If you need to the upgrade your project, we suggest you to replace the Syncfusion.EJ and Syncusion.EJ.Web dlls.
Also, you need to replace the ej.web.all.min.js and themes related files from the latest version of installed location of Syncfusion control panel. |
I tried using the script generator. After about an hour, it still says, "Please wait while we generated the custom script...". It appears to be stuck or not working somehow, so that hasn't helped. |
We have created a new incident for this query please follow up that incident for further details.
|
The kb link to which you referred me hasn't helped, either. The current dashboard looks nothing like the example. It references version 13.4.0.56, and of course the current version is way beyond that at 16.2.0.41. The path it suggests (...Syncfusion\EssentialStudio\13.4.0.56\JavaScript\samples\web\dashboard\diagrambuilder) doesn't exist in my Syncfusion installation. I did find ...C:\Users\Public\Documents\Syncfusion \ASP.NET\16.2.0.41\Samples\Web\ Dashboard\DiagramBuilder.aspx (and .cs), but there are no .js files there with that file in that folder. I also found the folder ...C:\Users\Public\Documents\ Syncfusion\JavaScript\16.2.0.41\samples\ web\diagram, but those are all .html files -- not js or css files. Do I need all of those files, too? What about all of the files automatically brought into the project when I created a new Syncfusion project in Visual Studio? Are *all* of those necessary.
|
Please refer to the below attached document to get referenced files from the latest version of Syncfusion dashboard and create the sample.
|
I don't know how, exactly, to "upgrade" the sample project to the latest version. It appears that I have version 16.2460.0.41 installed, but how do I get that into the sample project? What files do I need? Which files are not necessary? The references and folder structure between the sample project and a new project are vastly different. There is no upgrade wizard that I can find, and trying to do this manually has proven to be next to impossible.
|
If you need to the upgrade your project, we suggest you to replace the latest version of Syncfusion.EJ and Syncusion.EJ.Web dlls from the below installed location.
[InstalledDrive]:\Program Files (x86)\Syncfusion\Essential Studio\ASP.NET\16.2.0.41\precompiledassemblies
Also, you need to replace the ej.web.all.min.js and themes related files from the latest version of installed location of Syncfusion control panel. |
I tried using the script generator. After about an hour, it still says, "Please wait while we generated the custom script...". It appears to be stuck or not working somehow, so that hasn't helped. |
We have created a new incident for this query please follow up that incident for further details.
|
The kb link to which you referred me hasn't helped, either. The current dashboard looks nothing like the example. It references version 13.4.0.56, and of course the current version is way beyond that at 16.2.0.41. The path it suggests (...Syncfusion\EssentialStudio\13.4.0.56\JavaScript\samples\web\dashboard\diagrambuilder) doesn't exist in my Syncfusion installation. I did find ...C:\Users\Public\Documents\Syncfusion \ASP.NET\16.2.0.41\Samples\Web\ Dashboard\DiagramBuilder.aspx (and .cs), but there are no .js files there with that file in that folder. I also found the folder ...C:\Users\Public\Documents\ Syncfusion\JavaScript\16.2.0.41\samples\ web\diagram, but those are all .html files -- not js or css files. Do I need all of those files, too? What about all of the files automatically brought into the project when I created a new Syncfusion project in Visual Studio? Are *all* of those necessary.
|
Please refer to the below attached document to get referenced files from the latest version of Syncfusion dashboard and create the sample.
|
Thanks for the link to the support incident, however when I go to the link, I simply see a message that says, "No support incidents are associated with your account." Is there some other way to track progress on this incindent? |
Sorry for inconvenience caused.
Due to some internal issue, yesterday incident was not created. Now, we have created the incident for this query and kindly follow up with the incident further updates.
|