@Target(value={FIELD,METHOD,TYPE}) @Retention(value=RUNTIME) @Inherited @Documented @Repeatable(value=ModelFields.class) public @interface ModelField
| Modifier and Type | Fields and Description |
|---|---|
static String |
DEFAULTVALUE_UNDEFINED
Constant for the value undefined.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
allowBlank
Used for validating a model.
|
boolean |
allowNull
Use when converting received data into a
integer,
float/number, boolean or string type. |
String |
calculate
This config defines a simple field calculation function.
|
String |
convert
Function which coerces string values in raw data into the field's type
Typical use for a virtual field Property ' Ext.data.Field#convert' in JS. |
boolean |
critical
A critical field is a field that must always be sent to the server even if it has
not changed.
|
String |
customType
Type of the field.
|
String |
dateFormat
Specifies format of date.
|
String |
defaultValue
The default value.
|
String[] |
depends
The field name or names within the Model on which the value of this field depends,
and from which a new value may be calculated.
|
String |
mapping
Typical use for a virtual field to extract field data from the model object
Property ' mapping' in JS. |
boolean |
persist
If set to false prevents the value of this field to be serialized or written with
Ext.data.writer.Writer
Typical use for a virtual field Property ' persist' in JS. |
ReferenceConfig |
reference
Defines a relationship to another model.
|
ModelType |
type
Type of the field.
|
boolean |
unique
true if the value of this field is unique amongst all instances.
|
boolean |
useNull
If true null value is used if value cannot be parsed.
|
String |
value
Name of the field.
|
public static final String DEFAULTVALUE_UNDEFINED
defaultValue(). According to the
documentation setting defaultValue to undefined prevents defaulting a value.public abstract ModelType type
If not present and Model.autodetectTypes() is true the generator tries to
figure out the type. If not present and Model.autodetectTypes() is false
the type is set to 'auto'.
public abstract String customType
If not present the library tries to figure out the type.
If type() and customType() are present customType() has
precedence.
public abstract String defaultValue
Can be set to DEFAULTVALUE_UNDEFINED to set defaultValue to the value
undefined. This prevents defaulting a value.
public abstract String dateFormat
Will be ignored if the field is not a ModelType.DATE field.
public abstract boolean useNull
Only used if type of field is ModelType.INTEGER, ModelType.FLOAT,
ModelType.NUMBER, ModelType.STRING or ModelType.BOOLEAN.
public abstract boolean allowNull
integer,
float/number, boolean or string type. If the
value cannot be parsed, null will be used if allowNull is true, otherwise a default
value for that type will be used (0 for integer and float/number, "" for string and
false for boolean)
Defaults to false
Only used if type of field is ModelType.INTEGER, ModelType.FLOAT,
ModelType.NUMBER, ModelType.STRING or ModelType.BOOLEAN.
This is another name for useNull(). Both properties behave exactly
the same. Use only one.
public abstract boolean allowBlank
Defaults to true
public abstract boolean persist
Defaults to true
public abstract boolean critical
See Ext.data.field.FieldView#critical
Defaults to false
public abstract String[] depends
convert() method. If you do not have a convert() method then
this config should not be specified. Before using this config you should consider
if using a calculate() method instead of a convert() method would
be simpler.
See Ext.data.field.FieldView#depends
Defaults to null
public abstract String convert
public abstract String calculate
public abstract boolean unique
Defaults to false
public abstract ReferenceConfig reference
Copyright © 2013–2015. All rights reserved.