I'd like to have a dijit.form.Calendar embedded directly in my dojo form, rather than appearing as a popup (as dijit.form.DateTextBox provides; this is because the form is already a dropdown selector and just choosing a date would be much more natural than having to click again on the text box)
What's the easiest way to do this? I don't mind if the text box still appears and is editable (although that's not a requirement) - but the dijit.Calendar
docs say explicitly that you can't use it as a form element because it doesn't provide an input.
What I actually did was to create a new dijit widget that stores the value in a hidden text field. The basic idea follows in javascript and template, although the full implementation is more complex as it also includes using a custom calendar widget that also displays the time.
This has been cut down and not tested in this incarnation. I found that handling the constraints being passed through correctly and the value being fed back to the input was not a trivial task. Also
widgetsInTemplate
was critical to get this to load the calendar widget properly:Then the template looks roughly like this:
First Check out http://docs.dojocampus.org/dijit/Calendar
You are correct that this implementation of the calendar does not produce a form input. Here's how I have done it. Essentially when the user clicks a date we respond to the click by saving off the value to be used later.