How to disable a hover mouse or information box function with Onclick

655
1
02-27-2011 02:24 AM
AndrewGoh
New Contributor
Hi there,

I was wondering what syntax to use for an onclick button event to disable a hover mouse information tool?

I tried this without any effect:

<div dojoType="dijit.form.Button" id="deactivate" iconClass="deactivateIcon" onClick="queryTask. deactivate(esri.tasks.QueryTask());">Deactivate Mouse Hover</div>

The rest of the code is taken from the hover mouse sample posted on the ESRI samples page.
I have no problem creating onclick buttons to deactivate / disable navigation and draw tools, its the other functions, is '.deactivate' not correct for esri.tasks.QueryTask??
0 Kudos
1 Reply
DanielYim
New Contributor II
Can you explain what a "hover mouse information tool" is?

From what you've told us now, I'm assuming that you're trying to disconnect a function to a previously defined event.

So, say that you have this
var myHook = dojo.connect(myMap, "onSomeEvent", function() {
    doThis();
});


Notice here that the dojo.connect is assigned to a variable..
Now if you want doThis() to stop executing every onSomeEvent, do the following:

dojo.disconnect(myHook);


Hope that helps.
0 Kudos