/*
* - LGPL
*
- * Input
- *
+ * Number field
*/
/**
allowNegative : true,
/**
- * @cfg {Boolean} allowNegative False to prevent entering a negative sign (defaults to true)
+ * @cfg {Boolean} allowZero False to blank out if the user enters '0' (defaults to true)
*/
allowZero: true,
/**
* if a valid character like '.' or '-' is left in the field with no number (defaults to "{value} is not a valid number")
*/
nanText : "{0} is not a valid number",
- /**
- * @cfg {Boolean} castInt (true|false) cast int if true (defalut true)
- */
- castInt : true,
/**
* @cfg {String} thousandsDelimiter Symbol of thousandsDelimiter
*/
this.hiddenEl().dom.value = (v === null || v === undefined ? '' : v);
- this.inputEl().dom.value = v == '' ? '' :
+ this.inputEl().dom.value = (v == '') ? '' :
Roo.util.Format.number(v, this.decimalPrecision, this.thousandsDelimiter || '');
- if(!this.allowZero && !v) {
+ if(!this.allowZero && v === '0') {
this.hiddenEl().dom.value = '';
this.inputEl().dom.value = '';
}
beforeBlur : function()
{
- if(!this.castInt){
- return;
- }
-
var v = this.parseValue(this.getRawValue());
- if(v || v === 0){
+ if(v || v === 0 || v === ''){
this.setValue(v);
}
},