We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Node label error

Hi,

In my project, I have a palette and within this palette there are few types of nodes. These nodes are added to the palette with labels. (refer to the attached screenshot)

Problem  1: 

When I drag a node from palette and drop to the canvas, for "Start" and "End" node it works fine; the label is moving with the node and will always stay within the node.  

But for the other types of node, same operation performed, the label will only stay at the location where it first hit the canvas (not yet drop the node) and as I move the node, I am only moving the shape not with the label.

And, let's say if I'm not dropping the node, I move the node in and out from the palette to canvas, its label will be duplicated and stay at the point I move out the node.

As attached is the screenshot of the scenario, the code i wrote to create the palette, the palette item and also code for the event of OnDropPaletteItem.

Also I am using the DiagramBuilder scripts. I suspect it somehow cause this problem.


Problem 2:

I notice there is a private member call "_absolutePath" in a node. What exactly it is?


Thanks.




 







Attachment: sync_4e10f4e.zip

3 Replies

SG Shyam G Syncfusion Team May 26, 2015 12:38 PM UTC

Hi Alvin

Thanks for using Syncfusion products.

Query
Response

Problem 1:

When I drag a node from palette and drop to the canvas, for "Start" and "End" node it works fine; the label is moving with the node and will always stay within the node.

But for the other types of node, same operation performed, the label will only stay at the location where it first hit the canvas (not yet drop the node) and as I move the node, I am only moving the shape not with the label.

And, let's say if I'm not dropping the node, I move the node in and out from the palette to canvas, its label will be duplicated and stay at the point I move out the node.

As attached is the screenshot of the scenario, the code i wrote to create the palette, the palette item and also code for the event of OnDropPaletteItem.

Also I am using the DiagramBuilder scripts. I suspect it somehow cause this problem.

We have applied your code snippet in our sample and we are unable to reproduce the reported issue at our end. could you please provide us more details such as Essential studio version that you are using in your application and code snippet of createNodes, createNodeLabel method that you have used in your application or video or modify the below sample to reproduce the reported issue at our end? This will help us to verify further and provide a better solution to you.
Sample:http://www.syncfusion.com/downloads/support/forum/119222/F119222689499486.zip
Video:http://www.syncfusion.com/downloads/support/forum/119222/labelissuealvinvideo1154742690.zip


Problem 2:

I notice there is a private member call "_absolutePath" in a node. What exactly it is?

Please note that the _absolutePath is an private member, that contains the path data relative to node's dimensions. We use this internally in the source and it should not be used in the sample.


Please let me know if any concerns.

Regards,
Shyam G


AP Alvin Phang May 27, 2015 10:47 AM UTC

Thank you for the sample.

After comparing the sample with my solution, FINALLY, I notice what goes wrong.

The problem is I put space for the node.Name (for example, node.name = "Set Condition") and this also explain why there has no issue for my Start and End node because both the nodes contains only one word.

After removing the space, the all the issue i mentioned gone and it works perfectly fine.

So suppose I have "symbolpalette.ShowPaletteItemText = true;", and in my case I cannot put space for the node.name. So since the palette item text follow the node.name and I will get something like "SetCondition".  Is there any solution so I can get spacing for the text?


SG Shyam G Syncfusion Team May 28, 2015 09:48 AM UTC

Hi Alvin

Thanks for using Syncfusion products.

 Please note that the name which we set for an palette item will be shown in the palette. We will provide an API to render the text in the palette instead of the using the name to the palette item text. We consider this as a feature and we will implement this feature in any one of our upcoming releases.

Please let me know if any concerns.

Regards,
Shyam G

Loader.
Live Chat Icon For mobile
Up arrow icon