IntegerDataField

This field class handles field of type Number with no decimal digits.

class Person extends Model {
    static get fields() {
        return [
            'name',
            { name : 'age', type : 'int' }
        ];
    }
}

When a field is declared as a 'int', non-null values are promoted to Number type and decimals are removed using a specified rounding. This field type can be useful if a field value is received as a string but should be stored as a number or has a fractional component that must be rounded or truncated.

Configs

19
nullValue: Number= 0

The value to replace null when the field is not nullable.

rounding: round | floor | ceil= round

The Math method to use to ensure fractional component is removed.

alwaysWriteDataField
calculateDataField
columnDataField
compareDataField
dataSourceDataField
defaultValueDataField
descriptionDataField
internalDataField
labelDataField
nameDataField
nullableDataField
nullTextDataField
persistDataField
readOnlyDataField

Properties

7

Class hierarchy

isIntegerDataField: Boolean= truereadonly
Identifies an object as an instance of IntegerDataField class, or subclass thereof.
isIntegerDataField: Boolean= truereadonlystatic
Identifies an object as an instance of IntegerDataField class, or subclass thereof.
isDataFieldDataField

Lifecycle

configBase

Functions

19

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase

Other

convertDataField
isEqualDataField
printDataField
printValueDataField
serializeDataField