dojo gfx 中形状的事件处理
我正在创建一个表面并在其上绘制一些形状。现在正在执行一个
dojo.connect(iSurface.getEventSource(), "mousedown", HandleMouseDown);
并在处理程序期间尝试使目标形状可移动。
HandleMouseDown(event)
{
foo = new dojox.gfx.Moveable(event.target);
}
然而我不断收到“this.shape.connect 不是一个函数”,我认为这是因为 event.target 是 svg 矩形而不是 gfx 形状对象。谁能帮我找到如何在事件中获取 gfx 形状对象而不是底层 svg 对象?
谢谢。
I am creating a surface and drawing some shapes onto it. Now doing a
dojo.connect(iSurface.getEventSource(), "mousedown", HandleMouseDown);
and during handler trying to make the target shape moveable.
HandleMouseDown(event)
{
foo = new dojox.gfx.Moveable(event.target);
}
However I keep getting "this.shape.connect is not a function", I think this is due to the fact that event.target is a svg rect not a gfx shape object. Can anyone help me in finding how do I get gfx shape object in the event instead of underlying svg object?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以提供上下文作为 dojo.connect: 的参数,
或者如果 shapeObj 对象属于 this:
并在事件处理程序中包含 this.shapeObj:
You can provide context as an argument to dojo.connect:
or if shapeObj object belongs to this:
and have this.shapeObj in event handler: