javascript - Why would a change to a label or icon on a dojo IconMenuItem while the page is running not change the page? -
when have html set , run js code through web browser iconmenuitem never visually changes icon or label. after js runs , call function on iconmenuitem, direct iconmenuitem.label not empty , iconmenuitem.icon "images/icon.png". how element's values changed visually in browser, iconmenuitem not change?
html:
<script type="text/javascript" data-dojo-config="isdebug: false, async: true, parseonload: true, mblhideaddressbar: false" src="dojo/dojo.js"></script>
<div data-dojo-type="dojox.mobile.swapview" id="mainpageview" data-dojo-props="selected:true"> <ul data-dojo-type="dojox.mobile.iconmenu" id="menu" style="width: 320px; height: 400px;" data-dojo-props="cols: 3"> <li data-dojo-type="dojox.mobile.iconmenuitem" label="empty" onclick=handlebutton(this) id="btn1"></li>
js:
require(['dijit/registry'], function(registry) { var actualbutton = registry.byid("btn1"); actualbutton.label=checkbox.title.substring(2); actualbutton.icon="images/icon.png"; wl.logger.debug(actualbutton.id+ "'s label now: " + actualbutton.label); });
try using set method ex.
actualbutton.set({label:'newvalue',icon:'iconvalue'});
Comments
Post a Comment