PDA

View Full Version : Problem with SVG Objects Events



alei.alhepSoft
21 Aug 2010, 6:04 PM
Hellow!
I'm using Raphael with Ext and I want add a event to svg object that raphael dont support.
I'm doing :
var canvas = new Raphael("myDiv",640,480);
var c = canvas.circle(100,100,100);
var cEl = Ext.get(c.node);
cEl.on("contextmenu",function(event){window.alert("hellow!")});

But that is not working.
I test with the "click" event and works.
Why do you think that dont work with the contextmenu event?

aw1zard2
21 Aug 2010, 9:21 PM
Which browser are you using with it?

Some browsers block JavaScript from disabling or replacing the context menu like Firefox does.

:)

It's in the options for Firefox, if your using Firefox. I believe in the content section then click the advance button next to the enable JavaScript.

Animal
22 Aug 2010, 12:33 AM
http://www.sencha.com/forum/showthread.php?79954-Simple-BoxComponent-which-encapsulates-a-Raphael-canvas&p=494563#post494563

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/raphaelcontextmenu.png

alei.alhepSoft
22 Aug 2010, 4:50 AM
Thkz animal.
In that example you are applying the events to the canvas. I'm aplying the events to a svg element.
How do you make for that the menu appear when you right click on a sector?
Why my the code of my first post dont works?