devol
10-14-2006, 01:35 AM
Hopefully this one doesn't have anything wrong with it. :)
// Add the config option
YAHOO.ext.grid.NumberEditor.prototype.defaultValue = '';
// Mask the old validate
YAHOO.ext.grid.NumberEditor.prototype._nodefault_validate =
YAHOO.ext.grid.NumberEditor.prototype.validate;
YAHOO.ext.grid.NumberEditor.prototype.validate = function(){
retval = this._nodefault_validate(); // call the original validate
var dom = this.element.dom;
value = dom.value;
if(value.length < 1 && this.allowBlank) { dom.value = this.defaultValue }
return retval;
}
// Add the config option
YAHOO.ext.grid.NumberEditor.prototype.defaultValue = '';
// Mask the old validate
YAHOO.ext.grid.NumberEditor.prototype._nodefault_validate =
YAHOO.ext.grid.NumberEditor.prototype.validate;
YAHOO.ext.grid.NumberEditor.prototype.validate = function(){
retval = this._nodefault_validate(); // call the original validate
var dom = this.element.dom;
value = dom.value;
if(value.length < 1 && this.allowBlank) { dom.value = this.defaultValue }
return retval;
}