danyim

Advantages of esri.hide and esri.show over Dojo code?

Discussion created by danyim on Oct 20, 2010
Latest reply on May 12, 2011 by DSwingley-esristaff
Some context: In the past few weeks, I have been working extensively with the ArcGIS JS API and have successfully created an application for a project. Before I embarked on this task, I have never worked with ArcGIS maps/services, AJAX libraries such as Dojo, or even Javascript in general (I had only a cursory knowledge of JS, but I do come from a strong Java/C/C++ programming background).

Right now, I am in the stage of optimizing my code so that my page runs and loads faster, and one of the things that comes up during my code review is my method of hiding and showing elements.

From the snippets of code that I took from the ArcGIS samples, I see that I sometimes use
dojo.style("someId", "display", "none");
to hide elements, but just as often, sometimes I use
esri.hide(dojo.byId("someId"));


Is there any discrepancy between the two? Is one preferred over the other in some situations? Or is esri just providing a utility function that ultimately does the same thing as the Dojo example?

Thanks,
danyim

Outcomes