尝试使用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()则返回null。
发布于 2015-03-14 14:34:31
我已经创建了一个小提琴,它可以像预期的那样工作。
你能给我们看看你的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>https://stackoverflow.com/questions/29049741
复制相似问题