PDA

View Full Version : Ext.form.DatePicker enhancement to show label in Picker popup



Trixor
21 Dec 2010, 1:34 PM
Hey,

I have a form where I asks for 3 dates, so I figured it would be nice if the Ext.DatePicker displayed the label as well, so I made a small enhancement:




Ext.form.DatePicker.prototype.getDatePicker = function() {
if (!this.datePicker) {
if (this.picker instanceof Ext.DatePicker) {
this.datePicker = this.picker;
} else {
this.datePicker = new Ext.DatePicker(Ext.apply(this.picker || {}));
this.datePicker.toolbar.setTitle(this.label);
}

this.datePicker.setValue(this.value || null);

this.datePicker.on({
scope : this,
change: this.onPickerChange,
hide : this.onPickerHide
});
}

return this.datePicker;
};


Enjoy,
Trixor

BlackBook
6 Jul 2011, 1:20 AM
BIG THANKS FOR SHARING!

This is exactly what I need. Thank you!