PDA

View Full Version : Bind events to svg element



martijn1967b
11 Feb 2014, 4:10 AM
Can't figure it out how to bind a function to the onclick event of a svg element.
Whene adding a function which is in global namespace like alert, it's working fine. but it seems it aint can work with another scope. Tried *.on(...) and ext.fly(), but no result or error. Btw var base is the return value of a renderer of a grid

Can some one please help.

regards martijn



var base = new Ext.dom.Element(document.createElement('rect'), true);

base.set({
width: (this.columnWidth * this.entity.dagen) - 4,
height: 24,
rx: 4,
ry: 4,
fill: this.entity.kleur,
stroke: '#000000',
'stroke-width': 1,
style: 'opacity: 0.8'
});