bone
10 Feb 2010, 1:51 AM
Hello!
Ext.data.Field seems to have undergone some hidden changes from 3.0 to 3.1.1.
In 3.0 one could use the types 'integer' and 'boolean':
// excerpt DataField.js from Ext 3.0
case "int":
case "integer":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseInt(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "float":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseFloat(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "bool":
case "boolean":
cv = function(v){ return v === true || v === "true" || v == 1; };
break;
case "date":
Whereas in 3.1.1 I just spent an hour trying to figure out why ***t wasnt working, and it all boiled down to :
// excerpt DataField.js from Ext 3.0
case "int":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseInt(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "float":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseFloat(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "bool":
cv = function(v){ return v === true || v === "true" || v == 1; };
break;
I wouldnt mind these changes if I was aware of them!
Also, to top it of, the current api-docs for Ext.data.Field (http://www.extjs.com/deploy/dev/docs/?class=Ext.data.Field) says:
type : String
The data type for conversion to displayable value if convert has not been specified. Possible values are
auto (Default, implies no conversion)
string
int
float
boolean
date
Ext.data.Field seems to have undergone some hidden changes from 3.0 to 3.1.1.
In 3.0 one could use the types 'integer' and 'boolean':
// excerpt DataField.js from Ext 3.0
case "int":
case "integer":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseInt(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "float":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseFloat(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "bool":
case "boolean":
cv = function(v){ return v === true || v === "true" || v == 1; };
break;
case "date":
Whereas in 3.1.1 I just spent an hour trying to figure out why ***t wasnt working, and it all boiled down to :
// excerpt DataField.js from Ext 3.0
case "int":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseInt(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "float":
cv = function(v){
return v !== undefined && v !== null && v !== '' ?
parseFloat(String(v).replace(stripRe, ""), 10) : '';
};
break;
case "bool":
cv = function(v){ return v === true || v === "true" || v == 1; };
break;
I wouldnt mind these changes if I was aware of them!
Also, to top it of, the current api-docs for Ext.data.Field (http://www.extjs.com/deploy/dev/docs/?class=Ext.data.Field) says:
type : String
The data type for conversion to displayable value if convert has not been specified. Possible values are
auto (Default, implies no conversion)
string
int
float
boolean
date