How do I create unique IDs in a Dojo widget template?
问题 I have a Dojo widget that I'm writing that adds a label and an input box to the user's page. The for attribute of a label requires an HTML ID value, but a Dojo widget should not contain IDs in case multiple instances are created on the same page. So, does anyone have any suggestions on how to work around these conflicting needs? 回答1: Out the box, this is how the dijit registry sets WidgetID (this.id) if the configuration parameter is not present while constructing: constructor: function(args)