PDA

View Full Version : Datepicker and a list of allowed dates



zenrast
23 Nov 2014, 2:35 AM
Hello,

i have a list of "allowed dates". Now i would like to pass this list to a Datapicker component so
that the only dates users can select are those in the list.

What i imagine is that all dates in the Datapicker to be unselectable, except the ones that are in the "allowed list".
Is this possible?

joel.watson
24 Nov 2014, 1:12 PM
Hello,

i have a list of "allowed dates". Now i would like to pass this list to a Datapicker component so
that the only dates users can select are those in the list.

What i imagine is that all dates in the Datapicker to be unselectable, except the ones that are in the "allowed list".
Is this possible?

Hi zenrast--

Have you looked at the disabledDates (http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.form.field.Date-cfg-disabledDates) config? You should be able to craft a regular expression that does what you want.

Alternatively, if you only a have very short list of selectable dates, it might be worth using a different component (e.g., combobox, custom data view, etc).

Hope that helps!