Thursday, 6 November 2008

Dojo Tab Example Using Code

I have started on a Dojo project for work. While reading up on Dijit, I ran across an example of how to use Dijit controls using JavaScript. This intrigued me as I have never liked putting JavaScript code in the HTML like most of the Dojo examples.


Using the book as an example, I tried the same thing and of course it didn't work. lol. After a little Googling around a solution was found. First, in a tab container, the tabs themselves must be added as children to the tab container. Ok that makes sense. But once I removed the Dojo attribute for the tab container it no longer displayed on the page. Well, it turns out, to get the thing to display, you have to call the controls startup method to make this happen.


As a result of the experience I have written up an example with comments.

No comments:

Post a Comment