Select to view content in your preferred language

button to run code

657
1
02-14-2014 11:48 AM
jaykapalczynski
Honored Contributor
I have been testing some examples from Java Script api help...Right now I have two different HTML pages and each is doing something different.

1.  On a user click in the map it buffers an area and then uses that buffer to select records and return to a table.
2.  I have an editor that on click in the map it selects the feature and brings up the edit window to edit attributes.

What I want is a couple buttons on my page that will run each of the tools above.  But I dont want to have to click the button every time, rather click it once and that code will run on each click until the user selects the other tool.
Any thoughts or examples?  Do I have to encapsulate each tools code in a Function and then have some sort of on button click for each button that runs the JS code? 
How would I keep that code running until another tool is selected?
Thanks
0 Kudos
1 Reply
StephenLead
Honored Contributor
What I want is a couple buttons on my page that will run each of the tools above.  But I dont want to have to click the button every time, rather click it once and that code will run on each click until the user selects the other tool.


You need to set a listener which enables each function when its button is clicked, and disables the other functionality.
0 Kudos