Select to view content in your preferred language

API 3.7 - Dnd Movable AMD Style

1162
3
10-30-2013 01:51 PM
CurtisSpurlock
Emerging Contributor
I am using a movable object in my application.  Here is the code:
dnd = new Moveable(dom.byId("divDragPanel"), { handle: "imgDrag", skip: true });

I want to set up an event listener for the onMove event of the Moveable object.

If I set it up the legacy way it works fine:
    dojo.connect(dnd, "onMove", function (e) {
        //do something
    });

When I try to set it up AMD style it does not work:
    on(dnd, "onMove", function (e) {
         //do something
    });

Any ideas?
0 Kudos
3 Replies
NumaGremling
Deactivated User
When converting from Legacy to AMD, the �??on�?� in event names is taken out, as well as the element the event is connected to.
For example:

dojo.connect(mainMap, "onClick", findParcel); 

would change to:
mainMap.on("click", findParcel); 


I�??m not sure about the onMove event but try this:

dnd.on("move", function (e){
0 Kudos
CurtisSpurlock
Emerging Contributor
Thanks BritishSteel!  I tried your code but it did not work.
0 Kudos
JamesVillanueva
Regular Contributor
Try to change it to this:

on(dnd, "move", function (e) {
//do something
});
0 Kudos