If your question is: How do I set a different date in the calendar of a DateField control?
If you initialise the DateField
control with your custom date, the buildin DatePicker
will use that value as the highlighted date.
{
xtype: 'datefield',
value: '2011-02-28'
}
See the source file for Ext\src\widgets\form\DateField.js
in the following method:
/**
* @method onTriggerClick
* @hide
*/
// private
// Implements the default empty TriggerField.onTriggerClick function to display the DatePicker
onTriggerClick : function(){
if(this.disabled){
return;
}
if(this.menu == null){
this.menu = new Ext.menu.DateMenu({
hideOnClick: false,
focusOnSelect: false
});
}
this.onFocus();
Ext.apply(this.menu.picker, {
minDate : this.minValue,
maxDate : this.maxValue,
disabledDatesRE : this.disabledDatesRE,
disabledDatesText : this.disabledDatesText,
disabledDays : this.disabledDays,
disabledDaysText : this.disabledDaysText,
format : this.format,
showToday : this.showToday,
minText : String.format(this.minText, this.formatDate(this.minValue)),
maxText : String.format(this.maxText, this.formatDate(this.maxValue))
});
this.menu.picker.setValue(this.getValue() || new Date()); <--- LOOK HERE!!!
this.menu.show(this.el, "tl-bl?");
this.menuEvents('on');
},
But again, I'm not sure I understand your question :)