$ds
- Description:
데이터셋 유틸리티
Methods
(static) checkDuplicationData(ds, colsopt, checkUpdatedDataOnlyopt) → {$ds.DataDupInfo}
- Description:
데이터셋의 내용중 중복이 있는지 확인한다.
Examples
const dupInfo = checkDuplicationData(this.Dataset00, ['CD']);
const dupInfo2 = checkDuplicationData(this.Dataset00, ['CD'], false);
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
||
cols |
string | Array.<string> |
<optional> |
update를 무시할 colId, 생략시 전체 칼럼 |
|
checkUpdatedDataOnly |
boolean |
<optional> |
true
|
변경이 있는 데이터만 체크할지 여부 |
Returns:
중복 확인 결과 객체
- Type
- $ds.DataDupInfo
(static) clone(ds, filterStropt) → {nexacro.Dataset}
- Description:
데이터셋을 복사해 새로운 데이터셋을 만든다.
Example
var ds_clone = $ds.clone(this.Dataset00);
var ds_clone2 = $ds.clone(this.Dataset00, "HI_CD=='001'");
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
|
filterStr |
string |
<optional> |
필터링문자열 입력하면, 해당 조건에 맞는 행만 복사한다. |
Returns:
새로 만들어진 Dataset
- Type
- nexacro.Dataset
(static) copyColumns(dsFrom, dsTo)
- Description:
Dataset의 Column 정보를 다른 Dataset의 칼럼 정보로 변경한다
Example
$ds.copyColumns(this.Dataset00, this.Dataset01);
Parameters:
| Name | Type | Description |
|---|---|---|
dsFrom |
nexacro.Dataset | Column정보를 복사해올 대상 |
dsTo |
nexacro.Dataset | Column정보를 부여할 대상 |
(static) deduplication(ds) → {nexacro.Dataset}
- Description:
데이터 셋의 내용중 모든 column의 내용이 중복된 행을 제거해 모든 행을 고유하게 만든다.
변경 완료후 모든 row의 상태가 normal이 됩니다.
모든 column의 데이터가 같은 것만 중복으로 봅니다.
Example
$ds.deduplication(this.Dataset00);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
Returns:
중복이 제거된 Dataset, 원본 데이터셋과 동일한 Dataset
- Type
- nexacro.Dataset
(static) deleteMultiRows(ds, delRows) → {number}
- Description:
Dataset의 특정 행들을 삭제
Example
$ds.deleteMultiRows(this.Dataset00, [0,1,2,4,5]);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 행을 삭제할 Dataset |
delRows |
Array.<number> | 삭제할 행의 배열 |
Returns:
삭제된 행 수
- Type
- number
(static) deleteRow(ds, row) → {boolean}
- Description:
Dataset의 특정 행을 삭제
Example
$ds.deleteRow(this.Dataset00, 0);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 행을 삭제할 Dataset |
row |
number | 삭제할 행 |
Returns:
삭제 성공 여부
- Type
- boolean
(static) getColumnData(ds, colId) → {Array.<any>}
- Description:
데이터 셋의 특정 column의 데이터를 Object로 만든다.
Example
var obj = $ds.getColumnData(this.Dataset00, "COL01");
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
colId |
string | 값을 가져올 columnId |
Returns:
특정 column의 데이터
- Type
- Array.<any>
(static) getExptApplyRowTypes(ds, types)
- Description:
$ds.setExptApplyRowTypes로 설정한 예외 타입 목록을 가져온다.
Example
var types = $ds.getExptApplyRowTypes(this.Dataset00);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
types |
Array.<number> | applyChange 호출 시, 특정 rowType은 normal로 바뀌지 않도록 설정할 타입 |
(static) getRawIndex(ds, viewIndexopt) → {number}
- Description:
Dataset의 행의 필터 keystring해제 한 row index값을 가져온다.
Example
var rawIdx = $ds.getRawIndex(this.Dataset00, 0);
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ds |
nexacro.Dataset | Dataset |
|
viewIndex |
number |
<optional> |
rawindex를 가져올 viewindex 생략시 dataset의 현재 rowposition |
Returns:
계산된 rawindex
- Type
- number
(static) getRowData(ds, row) → {Object}
- Description:
데이터 셋의 특정 row의 데이터를 Object로 만든다.
Example
var obj = $ds.getRowData(this.Dataset00, 0);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
row |
number | 값을 가져올 row |
Returns:
특정 row의 데이터, {칼럼명 : 값} 형태
- Type
- Object
(static) getRowDataNF(ds, row) → {Object}
- Description:
필터링을 무시한 상태로 데이터 셋의 특정 row의 데이터를 Object로 만든다.
Example
var obj = $ds.getRowDataNF(this.Dataset00, 0);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
row |
number | 값을 가져올 row |
Returns:
특정 row의 데이터, {칼럼명 : 값} 형태
- Type
- Object
(static) hasDeletedRow(ds) → {boolean}
- Description:
Dataset에 삭제된 row가 있는지 확인한다.
Example
var isDeleted = $ds.hasDeletedRow(this.Dataset00);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
Returns:
삭제된 행의 존재 여부
- Type
- boolean
(static) hasEditedRow() → {boolean}
- Description:
Dataset에 신규 또는 수정이 발생한 row가 있는지 확인한다.
Example
var isEdited = $ds.hasEditedRow(this.Dataset00);
Returns:
신규/수정 행의 존재 여부
- Type
- boolean
(static) isUpdated(ds) → {boolean}
- Description:
Dataset에 신규/수정 또는 삭제가 발생한 row가 있는지 확인한다.
Example
var isUpdated = $ds.isUpdated(this.Dataset00);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
Returns:
신규/수정 또는 삭제된 행의 존재 여부
- Type
- boolean
(static) reBuild(ds, mappingInfo) → {nexacro.Dataset}
- Description:
데이터셋의 내용을 재구성한다. 변경 완료후 모든 row의 상태가 normal이 됩니다.
Example
$ds.reBuild(this.Dataset00, {
"EMPNO" : "USER_ID",
"ENAME" : "USER_NM",
"JOB" : "IDT_AUTH",
"DEPTNO" : "ORGN_CD",
});
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
mappingInfo |
Object | 재구성 정보, { oldColNm : newColNm } 형식으로 입력한다. |
Returns:
내용이 재구성된 Dataset, 원본 데이터셋과 동일한 Dataset
- Type
- nexacro.Dataset
(static) rowToParam(ds, rowopt) → {string}
- Description:
Dataset의 특정 row의 데이터를 transaction을 위한 param문자열로 만듭니다.
Example
var row = this.Dataset00.rowposition;
var param = $ds.rowToParam(this.Dataset00, row);
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
|
row |
number |
<optional> |
param으로 만들 row, 미입력시 해당 Dataset의 현재 row |
Returns:
parameter 문자열
- Type
- string
(static) saveJSON(ds) → {Object}
- Description:
Dataset의 내용을 Object로 만든다.
Example
var obj = $ds.saveJSON(this.Dataset00);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
Returns:
Dataset의 내용
- Type
- Object
(static) setExptApplyRowTypes(ds, types)
- Description:
setExptApplyRowTypes 특정 칼럼의 데이터를 rowType변경시 무시하도록 설정한다.
transaction 호출 완료후 applyChange가 자동으로 호출되며 모든 row의 rowType이 normal로 변경됩니다.
exptApplyRowTypes값으로 설정된 rowType들은 normal로 변경되지 않습니다.
등록 가능한 enum 은 nexacro.Dataset의 rowtype항목을 참조 바랍니다
Example
$ds.setExptApplyRowTypes(this.Dataset00, [Dataset.ROWTYPE_UPDATE,Dataset.ROWTYPE_INSERT]);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
types |
Array.<number> | applyChange 호출 시, 특정 rowType은 normal로 바뀌지 않도록 설정할 타입 |
(static) setExtUpdate(ds, cols)
- Description:
특정 칼럼의 데이터를 rowType변경시 무시하도록 설정한다.
CHK 로 생성한 체크박스등 값 변경이 일어나도 rowType이 변경되어선 안되는 칼럼을 설정합니다.
Example
$ds.setExtUpdate(this.Dataset00, ["USER_ID"]);
Parameters:
| Name | Type | Description |
|---|---|---|
ds |
nexacro.Dataset | 데이터셋 |
cols |
string | Array.<string> | update를 무시할 colId |
(static) setFlagBase(플래그)
- Description:
Flag기반 처리방식여부 세팅
- 글로벌 옵션변경 입니다. 변경시 모든 화면의 모든 Dataset의 처리방침이 일괄적으로 바뀝니다.
Example
$ds.setFlagBase(true);
Parameters:
| Name | Type | Description |
|---|---|---|
플래그 |
boolean | 기반 처리여부, true일경우 행 삭제시 플래그만 바뀐다. |
Type Definitions
DataDupInfo
- Description:
팝업 처리 완료 혹은 실패 시 실행될 콜백 함수에 전달될 파라미터의 형식.
Properties:
| Name | Type | Description |
|---|---|---|
isDup |
boolean | 중복여부 |
row1 |
number | 중복이 발생한 행 1 |
row2 |
number | 중복이 발생한 행 2 |
팝업 처리 완료 혹은 실패 시 실행될 콜백 함수에 전달될 파라미터의 형식.
Type:
- Object