Monday, October 18, 2010

Dojo Woes

So far things are going slowly. Lot's of layout issues. I would have had the UI skeleton done in a couple of hours in Flex or Silverlight. My issues aren't really with javascript itself, but more with Dojo. There's some things you need to do (like call startup) or not do (like create grids hidden); and if you don't, you're going to spend hours trying to troubleshoot why you can't get something to layout properly. And then that's where you start sprinkling in startup() and setTimeout(resize, 0) everywhere until something works. It is stuff like this that makes me pull my hair out. So far these are the specific problems I've hit:

"In order to set the overall size of a BorderContainer to the full size of the viewport, the element needs an explicit size set as well as a size on the BorderContainer itself. Otherwise, the computed style of the BorderContainer will report 0 rather than the browser-calculated size of the viewport."
"You can use a BorderContainer inside your own dijit template with a bit of care to call startup() on your dijit after it has been added to the DOM, so that its contained BorderContainer can lay itself out."
"It is not possible to create a grid as a child of a node which is set to be not displayed (display: none). If you need to do this though for some reason you can set the grids visibility to "hidden" and its position offscreen"

Yeah, I know, RTFM, but this is exactly the type of learning curve I am trying to avoid. The fact you get no indication that you violated some rule or just did something that's not supported sucks. Sure you have the same problem in other languages, but seems to be much worse in the js world.

No comments:

Post a Comment