Problem exteding Ext.form.DateField
March 13th, 2010I磎 subclassing the Ext.form.DateField to change the return value of getValue(). The value is being returned the way I expect but there磗 a problem in the behavior of the button in the component. First time I click on it, everything works fine, but when I click it again, Firebug tells me:
B.clearTime is not a function
initComponent("14/04/2008")ext-all.js (line 85)
initComponent()ext-all.js (line 128)
EventManager(Object browserEvent=Event resize button=-1 type=resize)ext-all.js (line 13)
getViewWidth(click clientX=0, clientY=0)ext-base.js (line 10)
[Break on this error] Ext.DatePicker=Ext.extend(Ext.Component,{todayText :"Today",okText:" OK ...
Above is the code of the sub-class:
// Create user extensions namespace (Ext.ux)
Ext.namespace('Ext.aquajax');
/**
* Ext.aquajax.AquaDateField
*
* @author Raphael Rissato
* @version 1.0
*
* @class Ext.aquajax.AquaDateField
* @extends Ext.form.DateField
* @constructor
* @param {Object} config Configuration options
*/
Ext.aquajax.AquaDateField = function(config) {
// chamando construtor pai.
Ext.aquajax.AquaDateField.superclass.constructor.c all(this, config);
};
Ext.extend(Ext.aquajax.AquaDateField, Ext.form.DateField, {
getValue: function(value) {
return Ext.aquajax.AquaDateField.superclass.getRawValue.c all(this);
}
});
Does anyone know any solution for this? Thank磗!
I solved it overriding the method onTriggerClick too.
onTriggerClick : function(){
if(this.disabled){
return;
}
if(this.menu == null){
this.menu = new Ext.menu.DateMenu();
}
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))
});
this.menu.on(Ext.apply({}, this.menuListeners, {
scope:this
}));
this.menu.picker.setValue(this.parseDate(this.getV alue()) new Date());
this.menu.show(this.el, "tl-bl?");
}
I onlychanged the bold part.
I磎 still trying to solve this. Any help is welcome. Thanks!
#If you have any other info about this subject , Please add it free.# |