RealGrid2 API
Interface
DataFieldObject

DataFieldObject

An object with the same structure as DataField used when setting.

Signature:

export interface DataFieldObject

Remarks

Used in setFields().

Example

//config
ds.setFields({
      fieldName: 'OrderID',
      dataType: 'text',
});

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
dataTypeValueTypedata type
datetimeFormatstringWhen the value is in date format, Format
defaultValueanyDefault data value for field
fieldNamestringfield name
headerstringGroup Header Title
lengthnumberdata length
maximumnumberlimit value of maximum range
minimumnumberMinimum range limit
objectCallbackany
objectKeystring
pmTextstringPM display text
requiredboolean(ALPHA) Data required
setany[]Fieldset
subTypestringDirective for using basic data types to a limited extent
valueExpressionstringFormula to be used if it is a calculated field

Event 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:

ds.setFields({
 fieldName: 'TotalPrice',
 dataType: 'text',
 valueCallback: function (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:

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'


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


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.


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.


objectCallback

Type - any


objectKey

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 - string

Remarks:

See ValueType


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:

ds.setFields({
 fieldName: 'TotalPrice',
 dataType: 'text',
 valueExpression: "values['Quantity'] * values['UnitPrice']"
});