Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extends function not set with jason reader #208

Open
hbagheri opened this issue Apr 8, 2022 · 1 comment
Open

extends function not set with jason reader #208

hbagheri opened this issue Apr 8, 2022 · 1 comment

Comments

@hbagheri
Copy link

hbagheri commented Apr 8, 2022

Thank you for your grate Library

i've added draw2d.Connection.extend to show a right click menu for connections
It works properly while create a new connection but not works if the connection was loaded from a saved JSON.
would you please help me to solve my problem

@freegroup
Copy link
Owner

freegroup commented Apr 10, 2022

if your read/write JSON from your drawd2d diagram, it is important that all elements has the attribute NAME.
This attribute is use late to create JS object instances.
https://github.com/freegroup/draw2d/blob/master/examples/connection_with_contextmenu/MyConnection.js#L12

If this attribute exists, the constructor of your Connection class is correct called and the coding for the cotext menue is executed.

https://freegroup.github.io/draw2d/#/examples/connection_with_contextmenu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants