{/* Do not edit this file. It is automatically generated by API Documenter. */}


## DataFieldObject

An object with the same structure as [DataField](/refs/Interface/DataField) used when setting.

**Signature:**

```typescript
export interface DataFieldObject
```

## Remarks

Used in [setFields()](/refs/Class/DataProviderBase#setfields).

## Example


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

## Events

| Property | Type | Description |
| --- | --- | --- |
| [valueCallback](/refs/Interface/DataFieldObject#valuecallback) | [FieldValueCallback](/refs/realgrid#fieldvaluecallback) | If it is a calculated field, the callback to be calculated by specifying a formula |

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [amText](/refs/Interface/DataFieldObject#amtext) | string | AM display text |
| [baseField](/refs/Interface/DataFieldObject#basefield) | string | criteria field |
| [baseYear](/refs/Interface/DataFieldObject#baseyear) | number | If the year value is less than 100, base year |
| [booleanFormat](/refs/Interface/DataFieldObject#booleanformat) | string | When the value is of type Boolean, Format |
| [dataType](/refs/Interface/DataFieldObject#datatype) | [ValueType](/refs/realgrid#valuetype) | data type |
| [datetimeFormat](/refs/Interface/DataFieldObject#datetimeformat) | string | When the value is in date format, Format |
| [defaultValue](/refs/Interface/DataFieldObject#defaultvalue) | any | Default data value for field |
| [fieldName](/refs/Interface/DataFieldObject#fieldname) | string | field name |
| [header](/refs/Interface/DataFieldObject#header) | string | Group Header Title |
| [length](/refs/Interface/DataFieldObject#length) | number | data length |
| [maximum](/refs/Interface/DataFieldObject#maximum) | number | limit value of maximum range |
| [minimum](/refs/Interface/DataFieldObject#minimum) | number | Minimum range limit |
| [objectCallback](/refs/Interface/DataFieldObject#objectcallback) | any | |
| [objectKey](/refs/Interface/DataFieldObject#objectkey) | string | |
| [pmText](/refs/Interface/DataFieldObject#pmtext) | string | PM display text |
| [required](/refs/Interface/DataFieldObject#required) | boolean | **_(ALPHA)_** Data required |
| [set](/refs/Interface/DataFieldObject#set) | any\[\] | Fieldset |
| [subType](/refs/Interface/DataFieldObject#subtype) | string | Directive for using basic data types to a limited extent |
| [valueExpression](/refs/Interface/DataFieldObject#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](/refs/realgrid#fieldvaluecallback)

**Remarks:**

References to other calculated fields in formulas are not allowed.

**Example:**


```js
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;
 }
});
```

<hr/>

## Properties Desc

### amText

AM display text

`Type` - string

<hr/>

### baseField

criteria field

`Type` - string

**Remarks:**

Used during verification.

<hr/>

### baseYear

Base year if year value is less than 100

`Type` - number

<hr/>

### 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](/refs/Interface/DataOutputOptions#booleanformat) takes precedence.

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

Example) `'Nub: Yub'`

<hr/>

### dataType

data type

`Type` - [ValueType](/refs/realgrid#valuetype)

**Remarks:**

See [ValueType](/refs/realgrid#valuetype)

<hr/>

### 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](/refs/Interface/DataOutputOptions#datetimeformat) takes precedence.

Example) `'yyyy-M-dd'`

<hr/>

### 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()](/refs/Class/GridView#begininsertrow){/* */}, [GridView.beginAppendRow()](/refs/Class/GridView#beginappendrow) function A new row is added in this input state.

<hr/>

### fieldName

field name

`Type` - string

<hr/>

### 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.

<hr/>

### length

data length

`Type` - number

<hr/>

### maximum

limit value of maximum range

`Type` - number

**Remarks:**

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

<hr/>

### minimum

Minimum range limit value

`Type` - number

**Remarks:**

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

<hr/>

### objectCallback

`Type` - any

<hr/>

### objectKey

`Type` - string

<hr/>

### pmText

PM display text

`Type` - string

<hr/>

### required

Is data required?

`Type` - boolean

<hr/>

### 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.

<hr/>

### subType

Directive for using basic data types to a limited extent

`Type` - string

**Remarks:**

See [ValueType](/refs/realgrid#valuetype)

<hr/>

### 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:**


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

<hr/>