DataFieldObject
An object with the same structure as DataField used when setting.
Signature:
export interface DataFieldObjectRemarks
Used in setFields().
Example
//config
ds.setFields({
fieldName: 'OrderID',
dataType: 'text',
});Events
| Property | Type | Description |
|---|---|---|
| valueCallback | FieldValueCallback | If it is a calculated field, the callback to be calculated by specifying a formula |
Properties
| Property | Type | Description |
|---|---|---|
| amText | string | AM display text |
| baseField | string | criteria field |
| baseYear | number | If the year value is less than 100, base year |
| booleanFormat | string | When the value is of type Boolean, Format |
| dataType | ValueType | data type |
| datetimeFormat | string | When the value is in date format, Format |
| defaultValue | any | Default data value for field |
| fieldName | string | field name |
| header | string | Group Header Title |
| length | number | data length |
| maximum | number | limit value of maximum range |
| minimum | number | Minimum range limit |
| objectCallback | any | |
| objectKey | string | |
| pmText | string | PM display text |
| required | boolean | (ALPHA) Data required |
| set | any[] | Fieldset |
| subType | string | Directive for using basic data types to a limited extent |
| valueExpression | string | Formula 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']"
});