Per the docs regarding the defaultValue config in Ext.data.Field:

(Optional) The default value used when a Model is being created by a Reader when the item referenced by the mapping does not exist in the data object (i.e. undefined). (defaults to "")

IMHO the defaulting to '' is a bug not a feature.

I'm finding the behavior of implicitly stuffing '' into defaultValue wrong on many levels:

(1) Principle of Least Surprise: If not explicitly specifying a defaultValue for a Field, most developers would assume it would be initialized with a NULL value, NOT an empty string.

(2) An empty string is not a sensible implicit defaultValue for any Field which is not 'string' type (i.e. date/int/etc.)

(3) When saving the Model to the backend, SQL cannot distinguish between a column which is has not been specified, vs one in which the user has actually entered an empty string in. By implicitly assuming a frontend default value of '' as opposed to NULL, a SQL default value will not be applied by the backend. Worse still, if the field was actually expected to be of 'int' type, then the empty string ('') default would cause a datatype constraint violation.

The fix to Ext.data.Field is trivial:

PHP Code:
/**
     * @cfg {Mixed} defaultValue
     * (Optional) The default value used <b>when a Model is being created by a {@link Ext.data.reader.Reader Reader}</b>
     * when the item referenced by the <code>{@link Ext.data.Field#mapping mapping}</code> does not exist in the data
     * object (i.e. undefined). (defaults to [B]null[/B])
     */
    
defaultValue: [B]null[/B],