OnClick event


#1

Is it possible to set up an onclick event for a node and have the click trigger a predefined javascript function?


#2

I assume you are talking about GoDiagram Web’s rendering of a GoView to do client-side actions. I also assume you have looked at the JavaScript that it generates.
I haven’t tried this, but it might be possible to redefine goMouseUp or goPost to do what you want. Note how cursors and tooltips are handled–mouse moves cause searches through corresponding arrays for hit testing. You could generate a similar array for your own mouse-up purposes.


#3

That is correct. I’m using GD Web rendering I ended up overriding the onSingleClick event and used server.transfer to call another page. i dropped the javascript idea … for now.
Thanks!


#4

Using your suggestion walter, I was able to override the onMouseUp event and replace it with my own javascript. Is there any way to add events to the image tag that is generated? example, if i wanted to handle a onMouseOver event, can GD render that call within the image tag?


#5

We have contemplated adding such support in a future version.