ibm mobilefirst - how to change the dojo gauge value in worklight -


i've created following gauge in index.html:

<div        data-dojo-type="dojox.dgauges.components.black.semicircularlineargauge" id="g1"      interactionarea = "none" value="0" minimum="0" maximum="100"    style="width:200px; height: 150px; margin-left: 40px;"></div>  

now need change value after user clicks on button, in main.js file. understand need use .set("value", x) function, how gauge id? tried document.getelementbyid('g1') , dojo.byid("g1") , doesn't work. thanks!

document.getelementbyid('g1') , dojo.byid('g1') return dom node, default not have built-in set method invoke. instead should use registry.byid retrieve actual widget, should have set method you're trying use.

require(["dijit/registry"], function(registry){     var x = 5; //or     var gauge= registry.byid("g1");     gauge.set("value", x); }); 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -