Opened 13 years ago

Closed 13 years ago

#1404 closed defect (invalid)

problem with event.disconnect

Reported by: martin@… Owned by: alex
Priority: high Milestone:
Component: Events Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

First disonnect perfectly... Second doesn't work

<script>
	var fncToCallAfter = function(){alert('what the ??');};
	
	var oTmp = {};
	oTmp.fncToCall = function(){alert('called');};
	oTmp.fncToCallAfter = function(){alert('not called');};
	
	
	//work
	dojo.event.connect('after', oTmp, "fncToCall", oTmp, "fncToCallAfter");
	dojo.event.disconnect('after', oTmp, "fncToCall", oTmp, "fncToCallAfter");
	
	
	//doesn't work
	dojo.event.connect('after', oTmp, "fncToCall", fncToCallAfter);
	dojo.event.disconnect('after', oTmp, "fncToCall", fncToCallAfter);
	
	
	oTmp.fncToCall();
</script>

Change History (1)

comment:1 Changed 13 years ago by jkuhnert

Resolution: invalid
Status: newclosed

Sorry if I'm butting in and breaking up a perfectly valid ticket, but I can see in the second disconnect example you haven't told it what to disconnect the function calls from..ie you are missing the oTmp parameter to the second function...The signatures have to look exactly the same to work...I think the second example probably just doesn't work at all?

Note: See TracTickets for help on using tickets.