Opened 6 years ago

Closed 6 years ago

#17414 closed defect (wontfix)

parser.instantiate - no result

Reported by: dojonovice@… Owned by:
Priority: undecided Milestone: tbd
Component: Parser Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

I dont know how to use parser.instantiate(). I tried several solutions but no result, resp. empty array. What is wrong?

<div id="myDiv" name="ABC" value="1"></div>

<script>

require(["dojo/parser", "dojo/dom"], function(parser, dom) {

parser.instantiate([dom.byId("myDiv")], {"data-dojo-type" : "dijit/form/TextBox"});

});

</script>

Attachments (1)

parser.html (330 bytes) - added by bill 6 years ago.
working test case

Download all attachments as: .zip

Change History (2)

comment:1 Changed 6 years ago by bill

Resolution: wontfix
Status: newclosed

It turns out that data-dojo-type doesn't work in the mixin parameter; you need to use the old dojoType:

parser.instantiate([dom.byId("myDiv")], {"dojoType" : "dijit/form/TextBox"});

Also, you need to preload dijit/form/TextBox, as the lazy loading doesn't work with the instantiate() method.

Changed 6 years ago by bill

Attachment: parser.html added

working test case

Note: See TracTickets for help on using tickets.