I communicated with the same. It seems you cannot do this because it is an svg object that Ext just โcatchesโ and adds several events to it. Since it does not have an actual alias (xtype), because it is not a component, it also cannot be queried. Unfortunately, you need to configure the listeners on the sprite.
In addition, I tried to make such a method as if you had expanded the sprite. I could not get this to work, I suppose, because it is not a component.
I was able to save this in everyone in the controller, because I draw sprites in the controller. That way I can manually identify listeners there and still use all the reference links, etc. Here is an example of one of my drawing functions:
drawPath: function(canvas,points,color,opacity,stroke,strokeWidth, listeners) { // given an array of [x,y] coords relative to canvas axis, draws a path. // only supports straight lines if (typeof listeners == 'undefined' || listeners == "") { listeners = null; } if (stroke == '' || strokeWidth == '' || typeof stroke == 'undefined' || typeof strokeWidth == 'undefined') { stroke = null; strokeWidth = null; } var path = path+"M"+points[0][0]+" "+points[0][1]+" "; // start svg path parameters with given array for (i=1;i<points.length;i++) { path = path+"L"+points[i][0]+" "+points[i][1]+" "; } path = path + "Z"; // end svg path params var sprite = canvas.surface.add({ type: 'path', opacity: opacity, fill:color, path: path, stroke:stroke, 'stroke-width': strokeWidth, listeners: listeners }).show(true); this.currFill = sprite; }
You can see where I just pass the parameter to the listeners, and I can define the object elsewhere. You can do this in your own function or anywhere in the controller. Although the actual sprite should be in the view, this makes them a bit more dynamic and allows you to manipulate them a bit.
source share