javascript - Dojo - how to I programatically modify dojo-props? -
i have toolbarbutton such:
<span data-dojo-type="dojox/mobile/toolbarbutton" data-dojo-props="label:'back', moveto:'config'" ></span>
you can see have moveto property declared 'config' how can programatically change that?
i want reuse button want call function modify value of moveto.
kinda this:
<span data-dojo-type="dojox/mobile/toolbarbutton" onclick="modifymoveto('somepath')" data-dojo-props="label:'back', moveto:'config'" ></span>
is part of template? if so, can give attach-point like
<span data-dojo-type="dojox/mobile/toolbarbutton" data-dojo-attach-point="mybutton" data-dojo-props="label:'back', moveto:'config'" ></span>
and change doing this:
this.mybutton.set("moveto", "somepath");
if not, can give id, 'mybutton', , code, use dojo's registry utility (dijit/registry), , this:
var btn = registry.byid("mybutton"); //this return widget btn.set("moveto", "somepath");
Comments
Post a Comment