我在这个 jsfiddle 中看不到你的问题。InlineEditBox
变成dijit,但不会<select>
。该示例可以同时尝试 Dojo 1.6.0 和 Dojo 1.8.3:
HTML:
<script>
var dojoConfig = {
parseOnLoad: false
};
</script>
<script>
var v16 = "https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js.uncompressed.js";
var v18 = "https://ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js";
var dojoUrl = v18;
document.writeln("<script src='" + dojoUrl + "'></scr" + "ipt>");
</script>
<table border="1">
<tr>
<th scope="row">
<div id="inlineEditBox1" dojoType="dijit.InlineEditBox">Stuff</div>
</th>
<td>
<select id="select1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</td>
</tr>
</table>
JS:
function dojo16ready() {
if (!(dojoConfig && dojoConfig.parseOnLoad)) {
dojo.parser.parse();
}
}
function dojo18ready(parser, registry) {
function go() {
console.log("inlineEditBox1", registry.byId("inlineEditBox1"));
console.log("select1", registry.byId("select1"));
}
if (!(dojoConfig && dojoConfig.parseOnLoad)) {
parser.parse().then(go);
}
}
function init() {
console.log("dojo.version", dojo.version);
if ("function" !== typeof require) {
// Must require before onload
dojo.require("dijit.InlineEditBox");
dojo.addOnLoad(dojo16ready);
} else {
require(["dojo/parser", "dijit/registry", "dijit/InlineEditBox"], dojo18ready);
}
}
init();