Do I need to require dojo/domReady! in Web AppBuilder widgets?

2629
1
Jump to solution
10-07-2015 07:35 AM
MarkRubelmann
New Contributor III

This is sort of a cross-post of this Stack Overflow question​, but I'd like to see if anyone has any Esri-centric thoughts on it.  I'm confused about whether or not I need to require dojo/domReady! anywhere within a custom widget.  Given that Web AppBuilder will have set up the DOM before my widget is loaded, my guess is it will always just return immediately, but I could be overlooking something.  Someone on SO suggested that calling ready() instead of requiring the dojo/domReady! plugin might be the correct thing to do.  Does anyone know what the best approach is for Web AppBuilder widgets?

1 Solution

Accepted Solutions
MarkRubelmann
New Contributor III

I don't know why I didn't think to do this earlier, but I just searched through all of the widgets included with Web AppBuilder.  I only found one widget that requires dojo/domReady!, so I'm guessing it's not needed anywhere.  I also didn't find anything using ready() or manually invoking the parser.  I guess the framework must take care of everything and widget authors don't need to worry about it!

View solution in original post

1 Reply
MarkRubelmann
New Contributor III

I don't know why I didn't think to do this earlier, but I just searched through all of the widgets included with Web AppBuilder.  I only found one widget that requires dojo/domReady!, so I'm guessing it's not needed anywhere.  I also didn't find anything using ready() or manually invoking the parser.  I guess the framework must take care of everything and widget authors don't need to worry about it!