AnsweredAssumed Answered

Event Propagation - bubbling

Question asked by AlexAnkrah on Sep 16, 2010
Latest reply on Sep 21, 2010 by AlexAnkrah
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;
}
}

Outcomes