Select to view content in your preferred language

Event Propagation - bubbling

1708
1
Jump to solution
09-16-2010 01:40 PM
AlexanderAnkrah
Deactivated User
Hi Folks,
There's a lot of help on connecting or disconnecting dojo events  been through most but I'm still having issues with stopping a map.graphics.clear () event bubbling over. I have tried disconnecting it in several places in the "pan" case as well as tried several approaches but it just wouldn't stop bubbling... any help welcome. cheers

function changeCursor(cursors) {
    var clrGrph = dojo.connect(map, "onMouseUp", function(event) { map.graphics.clear(); event.stopPropagation(); });
    //dojo.disconnect(clrGrph);
   
    switch (cursors) {
        case "pan":
            dojo.disconnect(clrGrph);// not responding
            alert("you"); //responds
            
            dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/hndopen.cur'),crosshair";
            down = dojo.connect(map, "onMouseDown", function(evt) {
            dojo.disconnect(clrGrph);// not responding
                dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/hndclosed.cur'),crosshair";
            });
            dojo.connect(map, "onMouseUp", function(evt) {
                dojo.disconnect(clrGrph); // not responding
                dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/hndopen.cur'),crosshair";
            });         
            
            break;
            
        case "extract_d":
            //dojo.connect(clrGrph);
            dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/extractData1.cur'),crosshair";
            dojo.connect(map, "onMouseDown", function(evt) {
                dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/extractData1.cur'),crosshair";
            });
            dojo.connect(map, "onMouseUp", function(evt) {
            dojo.connect(clrGrph);
                dojo.byId("Map_Panel_layers").style.cursor = "url('images/cursors/extractData1.cur'),crosshair";
              
            });
            break;
}
}
0 Kudos
1 Solution

Accepted Solutions
AlexanderAnkrah
Deactivated User
Sorted.The cases obviously didn't do the trick. Bizarrely the  Map.graphics.clear() worked as expected under an onDrawEnd event! Strange!

View solution in original post

0 Kudos
1 Reply
AlexanderAnkrah
Deactivated User
Sorted.The cases obviously didn't do the trick. Bizarrely the  Map.graphics.clear() worked as expected under an onDrawEnd event! Strange!
0 Kudos