I am using Go JS 1.7 evaluation version for self project. I have a scenario in which I am creating diagram nodes and relationships dynamically, that is, by fetching values from database. I want to show context menu on the node displayed in the diagram as per its Name property. I looked into some samples :
But these samples creates all the HTML menu in the HTML page and then just use show or hide functionality to displaay menu accordingly. In my case there could me 8-10 context menu on one node and hence creating all the menus before hand is not a option for me. Is there a way I can dynamically add context menu to the diagram?
I have tried a simple code:
But that still requires me to declare all possible menu before hand, I want to do that when user right click on the node object. May be write some code in “ObjectContextClicked” event. So that I can pass Node name (and any other properties required to fetch data from Database) and create Menu according to returned values.
Actually, I think you had the right idea in your first post, except that you need to modify the first argument, the Adornment that should be shown. Not create a new one and assign it – in that method it’s too late already.