How do I go about cloning a Dojo form (dijit.form.Form) with its child widgets? Ideally, i’d like to change the Id’s of the clone widgets as well. I also would be interested in cloning any events that might be attached to the widgets.
I played a bit with dojo.clone but that only works for DOM objects.
Thanks
Assuming inheritance is really what you need, then I’d just make a new widget. Assuming you are using the async loader and Dojo 1.7. I’d do something like:
If you’re using the sync loader, then you’ll want
dojo.declare:Your module will then be available with
var container = someElement; new path.to.File({}, container);. Or you could declare the widget in your markup. Let me know if I can make this more specific or apply to different versions of Dojo.