javascript - How do i have a Dojo checkbox run a command? -
i setting checkboxes enable/disable layers have on google earth project using dojo. understand how create checkboxes, , select , deselect them. how use these values, pass particular function. instance, have function can run in script, turn on borders on google earth, if marked true. have set if box checked, on, otherwise, uncheck turn off borders. here command turn them on:
ge.getlayerroot().enablelayerbyid(ge.layer_borders, true)
here code using showing checkbox in body of page:
<input id="bordercheck" name="bordercheck" dojotype="dijit.form.checkbox" value="on" checked /><label for="borders">turn borders on/off"</label>
here's quick , dirty suggestion, try:
<input id="bordercheck" name="bordercheck" dojotype="dijit.form.checkbox" value="on" checked onchange="ge.getlayerroot().enablelayerbyid(ge.layer_borders, arguments[0]);" /> <label for="borders">turn borders on/off</label>
assuming ge
global variable, of course.
Comments
Post a Comment