Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12062 closed defect (fixed)

dojoAttachEvent not working with dojo.dnd.Source in dijit templates

Reported by: cjolif Owned by: Eugene Lazutkin
Priority: high Milestone: 1.6
Component: DnD Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

dojoAttachEvent in dijit templates are working fine on regular HTML tags and regular dijit widgets but not on dojo.dnd.Source objects. This limitation is not specified here: http://docs.dojocampus.org/dijit/_Templated So this looks either like a documentation bug or a code bug. Considering how useful that is (at least as useful as for dijit widgets) I think the code should be fixed.

This can be worked around by explicitly adding the right properties to the Source object:

dojo.extend(dojo.dnd.Source,{
	       dojoAttachEvent: "",
	       dojoAttachPoint: "",
	       waiRole: "",
	       waiState:""});

Attach code reproduces the issue.

Attachments (1)

tests.zip (1.4 KB) - added by cjolif 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by cjolif

Attachment: tests.zip added

comment:1 Changed 9 years ago by Eugene Lazutkin

Component: GeneralDnD
Milestone: tbdfuture
Owner: changed from anonymous to Eugene Lazutkin
Status: newassigned

I am not sure if we want to support it --- use cases are not clear.

comment:2 Changed 9 years ago by bill

Description: modified (diff)
Milestone: future1.6
Resolution: fixed
Status: assignedclosed

I think actually it is already supported, by using the new parser syntax of data-dojo-attach-event and data-dojo-attach-point. Didn't actually try it, but you can see the InlineEditBox.html template as an example.

comment:3 Changed 9 years ago by cjolif

I confirm that this is working with the new syntax in 1.6:

<div>
<div data-dojo-type="dojo.dnd.Source" class="container"
	data-dojo-attach-event="onDrop:onDrop"
	horizontal="true" style="height: 30px; background: grey"></div>
<br />
</div>

(even though still not working with "old" syntax...)

Note: See TracTickets for help on using tickets.