我正在使用 Dojo Toolkit 开发一个移动应用程序。我有以下小部件:
define("js/custom/CustomHeading", [ "dojo/_base/declare", "dojo/dom-construct",
"dojo/dom-class", "dojox/mobile/Heading", "dojox/mobile/ToolBarButton",
"dojo/ready" ], function(declare, domConstruct, domClass, Heading,
ToolBarButton, ready) {
return declare("js.custom.CustomHeading", [ Heading ], {
buildRendering : function() {
this.inherited(arguments);
navigationButton = new dojox.mobile.ToolBarButton({
icon : "js/custom/images/navigation.png"
});
navigationButton.placeAt(this.domNode);
ready(function() {
console.log("I entered the block.");
});
}
});
});
如果我尝试使用 找到我的 html 中的小部件dijit.byId()
,我不会得到成功的结果。Dojo 找不到小部件,但它在那里。我要查找的小部件如下所示:
<div id="navigationOverlay" data-dojo-type="dojox.mobile.Overlay">
<ul data-dojo-type="dojox.mobile.RoundRectList">
<li data-dojo-type="dojox.mobile.ListItem"
data-dojo-props="moveTo:'dataServerRuntime',transition:'slide',label:'Health Summary'"
onclick="hideNavigation();"></li>
</ul>
</div>
我究竟做错了什么?如何找到小部件?