简体   繁体   中英

Groovy/Grails: How do I make my datePicker blank or null by default instead of showing today's date?

That is basically my question. It is showing me today's date and not a blank or null or '' date, even if I put null or '' it runs perfectly but keeps showing me today's date, not a blank dropdown box. So I want to change the default to being blank when the gsp loads, not with today's date.

Thanks

The usage of the attribute default is not documented in the Grails documentation but its functionality can be extracted from the implementation. Use the attribute default="none" to stop the datePicker from using the current date and provide an empty text as the noSelection value:

<g:datePicker default="none" noSelection="['':'']" />

More information about the attribute noSelection can be found in the Grails documentation .

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