PDA

View Full Version : datefield: setting datepicker config-options on create?



tobiu
7 Aug 2007, 2:59 PM
hi together,

i wonder if it is possible to configurate the datepicker-item while creating a datefield.

i think on something like:


new Ext.form.DateField({
msgTarget: "side",
fieldLabel: 'Birthday',
name: 'dateOfBirth',
width:150,
format:'d.m.Y',
{okText:"This Day", monthYearText:"Choose your birthdate"}
})

in the api docs i found in the source of the dateField:


Ext.apply(this.menu.picker, {
minDate : this.minValue,
maxDate : this.maxValue,
disabledDatesRE : this.ddMatch,
disabledDatesText : this.disabledDatesText,
disabledDays : this.disabledDays,
disabledDaysText : this.disabledDaysText,
format : this.format,
minText : String.format(this.minText, this.formatDate(this.minValue)),
maxText : String.format(this.maxText, this.formatDate(this.maxValue))
});

so, there are some config-option that can be set, but not all?


any idea how to extend this properly?


thanks, tobiu

Troy Wolf
13 Feb 2008, 10:49 AM
I'd like to repeat tobiu's question. When creating a dateField, I can specify disabledDays and it is reflected in the date picker. I want to also be able to specify maxDate.

In any case, how do I access the datePicker object that gets auto-created by the dateField? I'd like to set maxDays on the datePicker.

Thanks! ~o)

tobiu
21 Feb 2008, 3:42 AM
i solved it like this:



include("../extJS/ext-2.0.1/ext-all.js");
include("../extJS/ext-2.0.1/build/locale/ext-lang-de.js");


after including the ext-all, include the language package and if you dont like names, change it there.


kind regards, tobiu

Troy Wolf
21 Feb 2008, 7:33 AM
i solved it like this:



include("../extJS/ext-2.0.1/ext-all.js");
include("../extJS/ext-2.0.1/build/locale/ext-lang-de.js");


after including the ext-all, include the language package and if you dont like names, change it there.


kind regards, tobiu
Huh? How does this answer the topic? Did you accidentally post this solution to the wrong thread?

tobiu
22 Feb 2008, 2:20 PM
i does not solve the problem, but you can globally at least change the month-names and such things in the calendar of the datefield.


kind regards, tobiu