DataFieldObject
설정할 때 사용하는 DataField 와 동일한 구조의 오브젝트
Signature:
export interface DataFieldObject Remarks
setFields() 에서 사용된다.
Example
// config
ds.setFields({
fieldName: 'OrderID',
dataType: 'text',
});Events
| Property | Type | Description |
|---|---|---|
| valueCallback | FieldValueCallback | calculated 필드일 경우 수식을 지정하여 계산 될 콜백 |
Properties
| Property | Type | Description |
|---|---|---|
| amText | string | 오전 표시 텍스트 |
| baseField | string | 기준 필드 |
| baseYear | number | 년도 값이 100보다 작을 경우 기준 년도 |
| booleanFormat | string | Boolean 형식의 값일 때 서식 |
| dataType | ValueType | 자료형 |
| datetimeFormat | string | 날짜 형식의 값일 때 서식 |
| defaultValue | any | 필드의 기본 데이터 값 |
| fieldName | string | 필드명 |
| header | string | 그룹 헤더 타이틀 |
| length | number | 데이터 길이 |
| maximum | number | 최대 범위의 한계값 |
| minimum | number | 최소 범위의 한계값 |
| objectCallback | any | |
| objectKey | string | |
| pmText | string | 오후 표시 텍스트 |
| required | boolean | (ALPHA) 데이터 필수 여부 |
| set | any[] | 필드셋 |
| subType | string | 기본 자료형을 제한된 범위로 사용하기 위한 지시자 |
| valueExpression | string | calculated 필드일 경우 사용될 수식 |
Events Desc
valueCallback
calculated 필드일 경우 수식을 지정하여 계산 될 콜백
Type - FieldValueCallback
Remarks:
수식에서 다른 calculated 필드의 참조는 허용하지 않는다.
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
오전 표시 텍스트
Type - string
baseField
기준 필드
Type - string
Remarks:
검증 시 사용된다.
baseYear
년도 값이 100보다 작을 경우 기준 년도
Type - number
booleanFormat
Boolean 형식의 값일 때 서식
Type - string
Remarks:
이 값이 지정되면 boolean 필드의 값을 출력할 때 변환 형식으로 사용된다.
DataOutputOptions.booleanFormat 에 설정된 값을 우선한다.
콜론(:) 또는 세미콜론(;)으로 구분하여 왼쪽은 false일 때, 오른쪽은 true일 때
예) 'Nub: Yub'
dataType
자료형
Type - ValueType
Remarks:
ValueType 참고
datetimeFormat
날짜 형식의 값일 때 서식
Type - string
Remarks:
이 값이 지정되면 datetime 필드의 값을 출력할 때 변환 형식으로 사용된다.
DataOutputOptions.datetimeFormat 에 설정된 값을 우선한다.
예) 'yyyy-M-dd'
defaultValue
필드의 기본 데이터 값
Type - any
Remarks:
기본값을 지정하면 GridView.beginInsertRow(), GridView.beginAppendRow() 함수 호출시 지정된 기본값이 입력된 상태로 새로운 행이 추가된다.
fieldName
필드명
Type - string
header
그룹 헤더 타이틀
Type - string
Remarks:
Row Grouping 시 그룹 헤더의 타이틀에 기준필드의 헤더 값을 표시할 수 있다.
length
데이터 길이
Type - number
maximum
최대 범위의 한계값
Type - number
Remarks:
숫자 또는 날짜형 자료형일 때 사용 가능하다.
minimum
최소 범위의 한계값
Type - number
Remarks:
숫자 또는 날짜형 자료형일 때 사용 가능하다.
objectCallback
Type - any
objectKey
Type - string
pmText
오후 표시 텍스트
Type - string
required
데이터 필수 여부
Type - boolean
set
필드셋
Type - any[]
Remarks:
배열에 포함된 값이 아니면 undefined로 저장되게 한다.
Boolean 자료형을 제외한 나머지 자료형에서 사용가능하다.
subType
기본 자료형을 제한된 범위로 사용하기 위한 지시자
Type - string
Remarks:
ValueType 참고
valueExpression
calculated 필드일 경우 사용될 수식
Type - string
Remarks:
values['필드명'], values[필드인덱스]로 참조한다.
수식에서 다른 calculated 필드의 참조는 허용하지 않는다.
Example:
ds.setFields({
fieldName: 'TotalPrice',
dataType: 'text',
valueExpression: "values['Quantity'] * values['UnitPrice']"
});