を宣言しようとしていますが、イベントをdijit TextBox
添付できません。focus
私は宣言的にそうしようとしました:
<div class="midArea_div">
<div class="searchBox_div">
<input type="text" data-dojo-name="searchBox_input" data-dojo-type="dijit.form.TextBox" data-dojo-props="placeHolder:'Search...'"class="searchBox"></input>
<script type="dojo/on" data-dojo-event="onFocus" data-dojo-args="evt">
alert("hi");
</script>
<div class="searchIcon_overlay"></div>
</div>
</div>
そしてまたプログラム的に。http://jsfiddle.net/YyFw5/
js:
require([
"dijit/dijit",
"dojo/parser",
"maqetta/space",
"maqetta/AppStates",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/form/TextBox",
"dojo/on"
]);
require(["dojo/ready", "dojo/dom", "dojo/_base/fx", "dojo/on", "dijit/registry"], function(ready, dom, base_fx, on, registry){
ready(function(){
// logic that requires that Dojo is fully initialized should go here
//on(registry.byId("searchBox_input"), "focus", function(a){alert("hi");});
});
});