0leg
0leg

Reputation: 14154

Dojo InlineEditBox wouldn't initialize

Trying to use InlineEditBox as it is described in the tutorial.

The code hasn't been changed:

require(["dijit/InlineEditBox", "dijit/form/Textarea", "dojo/domReady!"], function(InlineEditBox, Textarea){
    var eb = new InlineEditBox({
        editor: Textarea,
        autoSave: false
    }, "ieb").startup();
});

For some reason, I've got an error:

TypeError: Cannot read property 'on' of null

Running debugger show that InlineEditBox never initializes. E.g. new Button() creates a widget as shown in console, while new InlineEditBox() returns null.

Upvotes: 0

Views: 75

Answers (1)

frank
frank

Reputation: 3330

I have created a jsfiddle and it works as expected.

Can you show us your HTML code.?

<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>

Upvotes: 1

Related Questions