Making a Smarter TabContainer

June 25, 2010 by Ken · 4 Comments 

I’m sure this one has been asked numerous times, but it came up most recently on IRC from darkschneider (with an additional nod from ttrenka). The dijit.layout.TabContainer widget is tremendously useful, but it has a noticeable shortcoming that, while minor and innocuous, can still be irritating: if you’ve navigated between tabs and then close the current one, it always sends you back to the first tab in the container, rather than the previously active tab.

This is something I had noticed while working with Dojo on a mockup at my job over a year ago, and I developed a solution to it then. Now that I’ve got this blog here, I might as well share it for others’ benefit.

UPDATED on 6/28 to bring the example more in line with how TabContainer works in Dojo 1.4+

Read more

Writing Custom Save Logic for ItemFileWriteStore

June 22, 2010 by Ken · 5 Comments 

This post focuses on a question reincarnated most recently by cbarrett1 in the Dojo IRC channel:

  • How do I implement custom save logic on an ItemFileWriteStore?

This was always something I wanted to become familiar with, and upon initial inspection it seemed easy enough to implement an example. It’s also a prime opportunity to put across a few other general points as well. While the main intent of this post should be clear, it also briefly touches upon various other topics along the way, so hopefully there’s a little something for everybody who’s learning Dojo.

Read more