Military TimeTextBox inside InlineEditBox

After about an hour and a half looking through the tattered remains of the dojo/dijit online documentation, I was finally able to figure out what I was doing wrong trying to put a TimeTextBox inside of an InlineEditBox (with the help of the O’Reilly book and the Pragmatic Programmers book) These books have been invaluable to me not only when the Internet is dead, but when the online docs fail to deliver.

Getting the widgets nested was easy, but I had a hard time figuring out how to get the parameters to the timebox, namely. I was trying desperately to make the time box in military time.

My initial markup was something like:

<span dojoType=”dijit.InlineEditBox”
id=”start_time”
editor=”dijit.form.TimeTextBox”
editorParams=”{timePattern:’HH:mm’}”
name=”time”
onChange=”foo()”>

It turns out I had forgotten the ‘constraints’ aspect of the editorParams. So the correct code for putting a military time timetextbox inside of an inlineeditbox is:

<span dojoType=”dijit.InlineEditBox”
id=”start_time”
editor=”dijit.form.TimeTextBox”
editorParams=”{constraints:{timePattern:’HH:mm’}}”
name=”time”
onChange=”foo()”>

Doh!

Tags: , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: