$grid

Namespace

$grid

Description:
  • 그리드 관련 유틸리티

Author:
  • 이승갑 (dltmdrkq2@gmail.com)
  • 정민석 (whitn86@gmail.com)

Methods

(static) addTreeChildRow(grd, row) → {number}

Description:
  • Tree형태의 Grid에서 특정 row의 자식 행을 추가한다.

Example
$grid.addTreeChildRow(this.Grid00, 10);
Parameters:
Name Type Description
grd nexacro.Grid

행을 추가할 Grid

row number

자식을 추가할 row

Returns:

추가된 자식 row

Type
number

(static) addTreeSiblingRow(grd, row) → {number}

Description:
  • Tree형태의 Grid에서 특정 row의 형제 행을 추가한다.

Example
$grid.addTreeSiblingRow(this.Grid00, 10);
Parameters:
Name Type Description
grd nexacro.Grid

행을 추가할 Grid

row number

자식을 추가할 row

Returns:

추가된 자식 row

Type
number

(static) calcFitSize(grd, minRow, maxRow) → {Object}

Description:
  • Grid의 내용에 딱 맞는 크기를 구한다.

Example
$grid.calcFitSize(this.Grid00, 3,5);
Parameters:
Name Type Description
grd nexacro.Grid

행을 추가할 Grid

minRow number

최소한 표시할 행 수, -1 또는 미입력 시 0과 동일하게 동작

maxRow number

최대로 표시할 행 수, -1 또는 미입력시 무제한

Returns:

크기 정보
{ width : 100 , height : 10 }

Type
Object

(static) cellFix(grd, cell)

Description:
  • Grid의 특정 cell을 고정처리한다.

Example
$grid.cellFix(this.Grid00, 4);
Parameters:
Name Type Description
grd nexacro.Grid

셀을 고정할 Grid

cell number

고정 처리할 head cell index

(static) cellUnFix(grd)

Description:
  • Grid에 설정되어있는 cellFix를 해제한다.

Example
$grid.cellUnFix(this.Grid00);
Parameters:
Name Type Description
grd nexacro.Grid

셀을 고정 해제할 Grid

(static) colFix(grd, colidx)

Description:
  • Grid의 특정 column을 기준으로 셀을 고정처리한다.

Example
$grid.colFix(this.Grid00, 4);
Parameters:
Name Type Description
grd nexacro.Grid

칼럼을 고정할 Grid

colidx number

고정 처리할 column index

(static) colUnFix(grd)

Description:
  • Grid에 설정되어있는 colFix를 해제한다.

Example
$grid.colUnFix(this.Grid00);
Parameters:
Name Type Description
grd nexacro.Grid

칼럼을 고정 해제할 Grid

(static) deleteMultiRows(grd, rows, useWaitCursoropt)

Description:
  • Grid의 특정 행 들을 삭제한다.

Example
$grid.deleteMultiRows(this.Grid00, [0,3,4]);
Parameters:
Name Type Attributes Default Description
grd nexacro.Grid

데이터를 삭제할 Grid

rows Array.<number>

삭제할 row들(dataset 기준)

useWaitCursor boolean <optional>
true

waitcursor 활성 여부

(static) getCellBind(grd, cell) → {string}

Description:
  • 특정 BodyCell에 바인딩 된 칼럼명을 가져온다.

Example
var colNm = $grid.getCellBind(this.Grid00, 3);
Parameters:
Name Type Description
grd nexacro.Grid

칼럼명을 찾을 Grid

cell number

칼럼명을 찾을 bodycell의 index

Returns:

해당 cell의 Column명

Type
string

(static) getComboCodeColumn(grd, colNm) → {string}

Description:
  • Grid의 특정 Column에 콤보로 바인딩 되어있는 Dataset의 칼럼 중, 실제 값에 해당하는 칼럼을 가져온다.

Example
$grid.getComboCodeColumn(this.Grid00, "COM_CD");
Parameters:
Name Type Description
grd nexacro.Grid

콤보가 세팅되어있는 Grid

colNm string

콤보가 세팅되어있는 칼럼명, Grid의 column명을 기준으로 한다.

Returns:

실제 값에 해당하는 칼럼명, 콤보에 바인딩 되어있는 Dataset의 칼럼명을 기준으로 한다.

Type
string

(static) getComboDataColumn(grd, colNm) → {string}

Description:
  • Grid의 특정 Column에 콤보로 바인딩 되어있는 Dataset의 칼럼 중, 표시될 값에 해당하는 칼럼을 가져온다.

Example
$grid.getComboDataColumn(this.Grid00, "COM_CD");
Parameters:
Name Type Description
grd nexacro.Grid

콤보가 세팅되어있는 Grid

colNm string

콤보가 세팅되어있는 칼럼명, Grid의 column명을 기준으로 한다.

Returns:

표시될 값에 해당하는 칼럼명, 콤보에 바인딩 되어있는 Dataset의 칼럼명을 기준으로 한다.

Type
string

(static) getComboDataset(grd, colNm) → {nexacro.Dataset}

Description:
  • Grid의 특정 Column에 바인딩 되어있는 Combo용 Dataset을 가져온다.

Example
var ds = $grid.getComboDataset(this.Grid00, "COM_CD");
Parameters:
Name Type Description
grd nexacro.Grid

콤보가 있는 Grid

colNm string

콤보가 세팅되어있는 칼럼명

Returns:

바인딩 되어있는 Dataset

Type
nexacro.Dataset

(static) getHeadText(grd, cell) → {nexacro.BindableValue}

Description:
  • Grid 특정 headCell의 text를 가져온다.

Example
var headTextInfo = $grid.getHeadText(this.Grid00, 3);
var headText = headTextInfo + "";
Parameters:
Name Type Description
grd nexacro.Grid

head text를 가져올 Grid

cell number

값을 가져올 cell index

Returns:

특정 headCell의 text 정보

Type
nexacro.BindableValue

(static) getHeadTexts(grd) → {Object}

Description:
  • Grid head의 text들을 배열로 가져온다.

Example
var headTextObj = $grid.getHeadTexts(this.Grid00);
// { length: 3, "상태": 0, "이름": 1, "확인여부": 2, 0:"상태", 1:"이름", 2:"확인여부" }
var arrText = Array.from(headTextObj);
// ["상태","이름","확인여부"]
Parameters:
Name Type Description
grd nexacro.Grid

head text를 가져올 Grid

Returns:

해당 Grid가 가진 모든 headCell의 text 정보

Type
Object

(static) getLastTreeChildRow(grd, row) → {number}

Description:
  • Tree형태의 Grid에서 특정 row의 마지막 자손 행을 찾는다.

    Tree가 아니거나, 자식이 없을 경우 현재 row를 그대로 반환한다.

Example
$grid.getLastTreeChildRow(this.Grid00, 3);
Parameters:
Name Type Description
grd nexacro.Grid

데이터를 찾을 Grid

row number

자손행을 찾을 row (Grid 기준)

Returns:

마지막 자손 row

Type
number

(static) getTreePath(grd, row) → {Array.<number>}

Description:
  • Tree형태의 Grid에서 특정 row의 경로를 가져온다.

Example
$grid.getTreePath(this.Grid00, 10);
Parameters:
Name Type Description
grd nexacro.Grid

데이터를 찾을 Grid

row number

경로를 찾을 row (Dataset 기준)

Returns:

경로에 해당하는 row 배열(Dataset 기준)

Type
Array.<number>

(static) openParentTree(grd, row)

Description:
  • Tree형태의 Grid에서 특정 row의 부모 경로를 모두 연다

Example
$grid.openParentTree(this.Grid00, 10);
Parameters:
Name Type Description
grd nexacro.Grid

데이터를 찾을 Grid

row number

tree를 열 row

(static) saveXML(grd) → {string}

Description:
  • Grid의 내용을 현재 보이는 그대로 Dataset용 xml로 만든다.

    모든 Column Id는 해당 cell의 cellIndex로 대체됩니다.
    이는 동일한 columnId가 바인딩 되어있는 여러 cell이 존재할 경우 충돌을 방지하기 위함입니다.

Example
var headTexts = $grid.saveXML(this.Grid00);
Parameters:
Name Type Description
grd nexacro.Grid

xml을 생성하고자하는 Grid

Returns:

생성된 xml 텍스트

Type
string

(static) setComboCodeColumn(grd, colNm, codeColNm)

Description:
  • Grid의 특정 Column에 콤보로 바인딩 되어있는 Dataset의 칼럼 중, 실제 값에 해당하는 칼럼을 설정한다.

Example
$grid.setComboCodeColumn(this.Grid00, "COM_CD","CD");
Parameters:
Name Type Description
grd nexacro.Grid

콤보를 세팅할 Grid

colNm string

콤보를 세팅할 칼럼명, Grid의 column명을 기준으로 한다.

codeColNm string

실제 값에 해당하는 칼럼명, 콤보에 바인딩 되어있는 Dataset의 칼럼명을 기준으로 한다.

(static) setComboDataColumn(grd, colNm, codeColNm)

Description:
  • Grid의 특정 Column에 콤보로 바인딩 되어있는 Dataset의 칼럼 중, 표시될 값에 해당하는 칼럼을 설정한다.

Example
$grid.setComboDataColumn(this.Grid00, "COM_CD","CD_NM");
Parameters:
Name Type Description
grd nexacro.Grid

콤보를 세팅할 Grid

colNm string

콤보를 세팅할 칼럼명, Grid의 column명을 기준으로 한다.

codeColNm string

표시될 값에 해당하는 칼럼명, 콤보에 바인딩 되어있는 Dataset의 칼럼명을 기준으로 한다.

(static) setComboDataset(grd, colNm, ds)

Description:
  • Grid의 특정 Column에 Combo용 Dataset을 바인딩.

Example
$grid.setComboDataset(this.Grid00, "COM_CD",this.ds_combo);
Parameters:
Name Type Description
grd nexacro.Grid

콤보 세팅할 Grid

colNm string

콤보를 세팅할 칼럼명

ds nexacro.Dataset

바인딩할 Dataset