Dojo InlineEditBox 不会初始化
Dojo InlineEditBox wouldn't initialize
正在尝试使用 tutorial 中描述的 InlineEditBox。
代码未更改:
require(["dijit/InlineEditBox", "dijit/form/Textarea", "dojo/domReady!"], function(InlineEditBox, Textarea){
var eb = new InlineEditBox({
editor: Textarea,
autoSave: false
}, "ieb").startup();
});
出于某种原因,我遇到了一个错误:
TypeError: Cannot read property 'on' of null
运行 debugger
显示 InlineEditBox 从不初始化。例如。
new Button()
创建一个小部件,如控制台所示,而 new InlineEditBox()
returns 为空。
我创建了一个 jsfiddle,它按预期工作。
你能告诉我们你的 HTML 代码吗?
<body class="claro">
<div id="ieb">
When you click on this div you'll be able to edit it (in plain text).
The editor's size will initially match the size of the (original) text, but will expand/contract as you type.
</div>
<script>
require(["dijit/InlineEditBox", "dijit/form/Textarea", "dojo/domReady!"], function(InlineEditBox, Textarea){
var eb = new InlineEditBox({
editor: Textarea,
autoSave: false
}, "ieb").startup();
});
</script>
</body>
正在尝试使用 tutorial 中描述的 InlineEditBox。
代码未更改:
require(["dijit/InlineEditBox", "dijit/form/Textarea", "dojo/domReady!"], function(InlineEditBox, Textarea){
var eb = new InlineEditBox({
editor: Textarea,
autoSave: false
}, "ieb").startup();
});
出于某种原因,我遇到了一个错误:
TypeError: Cannot read property 'on' of null
运行 debugger
显示 InlineEditBox 从不初始化。例如。
new Button()
创建一个小部件,如控制台所示,而 new InlineEditBox()
returns 为空。
我创建了一个 jsfiddle,它按预期工作。
你能告诉我们你的 HTML 代码吗?
<body class="claro">
<div id="ieb">
When you click on this div you'll be able to edit it (in plain text).
The editor's size will initially match the size of the (original) text, but will expand/contract as you type.
</div>
<script>
require(["dijit/InlineEditBox", "dijit/form/Textarea", "dojo/domReady!"], function(InlineEditBox, Textarea){
var eb = new InlineEditBox({
editor: Textarea,
autoSave: false
}, "ieb").startup();
});
</script>
</body>