简体   繁体   中英

How to get the value from a Dijit.Calendar?

This is an easy one, at least I thin it is.

I declared a Dijit.Calendar in my markup and it loads up fine and works. But I don't understand how I would access the value.

What I want to do is, that a textbox next to the calendar is updated to contain the date the user selected. I don't care if it's updated as soon as the user clicks a date or needs to somehow confirm his selection. I just want an idea on how to achieve this.

Sadly the reference guide doesn't provide any information other than how to set the thing up...

Answered by dleonardi on the dojo IRC.

Basically one connects the onChange event to the widget instance, which can be retrieved with dijit.byId() ( not dojo.byId() ).

The returned instance then simply contains a property called value , which is an instance of Date .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM