RealGrid2 API
Interface
DataField

DataField

data field model object

Signature:

export interface DataField

Remarks

Used in field-related methods of DataProvider.

Example

// model
let fields = ds.getFields();
ds.setFields(fields);

Events

PropertyTypeDescription
valueCallbackFieldValueCallbackIf it is a calculated field, the callback to be calculated by specifying a formula

Properties

PropertyTypeDescription
amTextstringAM display text
baseFieldstringcriteria field
baseYearnumberIf the year value is less than 100, base year
booleanFormatstringWhen the value is of type Boolean, Format
calculatedbooleanWhether it is a calculated field
dataTypeValueTypedata type
datetimeFormatstringWhen the value is in date format, Format
defaultValueanyDefault data value for field
fieldNamestringfield name
headerstringGroup Header Title
indexnumberindex of field
lengthnumberdata length
maximumnumberlimit value of maximum range
minimumnumberMinimum range limit
nullValueanyData to be replaced when data is null
orgFieldNamestringField name at the time of designation
pmTextstringPM display text
requiredboolean(ALPHA) Data required
setany[]Fieldset
subTypeValueTypeDirective for using basic data types to a limited extent
subTypeEnabledbooleanIndicator for using a data type in a limited range Availability
updatablebooleanWhether field values can be modified
valueExpressionstringFormula to be used if it is a calculated field

Events Desc

valueCallback

If it is a calculated field, the callback to be calculated by specifying a formula

Type - FieldValueCallback

Remarks:

References to other calculated fields in formulas are not allowed.

Example:

dataField.valueCallback = function (provider, dataRow, fieldName, fieldNames, values) {
 let quantity = values[fieldNames.indexOf("Quantity")];
 let unitprice = values[fieldNames.indexOf("UnitPrice")];
 if (isNaN(quantity) || isNaN(unitprice))
 return undefined;
 else
 return quantity >= 1000 ? Math.round(quantity * unitprice * 0.95) : quantity * unitprice;
}

Properties Desc

amText

AM display text

Type - string


baseField

criteria field

Type - string

Remarks:

When reading, it is output in uppercase letters.

When accessed and set as a property, it is saved in uppercase letters.

Used during verification.


baseYear

Base year if year value is less than 100

Type - number


booleanFormat

Formatting when the value is of type Boolean

Type - string

Remarks:

If this value is specified, it is used as a conversion format when outputting the value of a boolean field.

The value set in DataOutputOptions.booleanFormat takes precedence.

Separated with a colon (:) or semicolon (;), the left side is false, and the right side is true.

Example) 'Nub: Yub'


calculated

Is it a calculated field?

Type - boolean

Remarks:

If valueExpression or valueCallback is set, it is calculated.


dataType

data type

Type - ValueType

Remarks:

See ValueType


datetimeFormat

Format when the value is in date format

Type - string

Remarks:

If this value is specified, it is used as a conversion format when outputting the value of a datetime field.

The value set in DataOutputOptions.datetimeFormat takes precedence.

Example) 'yyyy-M-dd'


defaultValue

Default data value for the field

Type - any

Remarks:

If you specify a default value, the default value specified when calling the GridView.beginInsertRow(), GridView.beginAppendRow() function A new row is added in this input state.


fieldName

field name

Type - string

Remarks:

When reading, it is output in uppercase letters.

When accessed and set as a property, orgFieldName is set as is, and the property is set to uppercase for internal processing.


header

group header title

Type - string

Remarks:

When row grouping, the header value of the standard field can be displayed in the title of the group header.


index

index of field

Type - number


length

data length

Type - number


maximum

limit value of maximum range

Type - number

Remarks:

It can be used when the data type is numeric or date type.


minimum

Minimum range limit value

Type - number

Remarks:

It can be used when the data type is numeric or date type.


nullValue

Data to be replaced when data is null

Type - any


orgFieldName

Field name at the time of designation

Type - string


pmText

PM display text

Type - string


required

Is data required?

Type - boolean


set

field set

Type - any[]

Remarks:

If the value is not included in the array, it is stored as undefined.

It can be used in all data types except the Boolean data type.


subType

Directive for using basic data types to a limited extent

Type - ValueType

Remarks:

See ValueType


subTypeEnabled

Indicator for using a data type in a limited range Availability

Type - boolean


updatable

Whether field values can be modified

Type - boolean


valueExpression

Formula to be used if it is a calculated field

Type - string

Remarks:

Refer to values['field name'], values[field index].

References to other calculated fields in formulas are not allowed.

Example:

dataField.valueExpression = "values['Quantity'] * values['UnitPrice']";