nexacro:: findRow(), getEditValue(), getCellPos()
0. 상황
1) 중복 체크2) 키가 입력되었을 때 바로 확인
※ ajax와 같이 비동기식으로 확인
1. 사용할 메서드 및 함수
1) onkeyup: key입력했을 때 event 발생2) obj.getCellPos(): 선택된 cell의 index값을 반환
3) Dataset.findRow( strColID, strVal [ ,nStartIdx [ ,nEndIdx ] ] )
- 특정 column값과 전달된 값과 일치하는 데이터를 갖는 첫번째 row의 index를 반환
- strColID: Dataset에서 대상이 되는 column id
- strVal: strColID에 해당되는 column에서 검색할 값을 설정
- nStartIdx: Dataset에서 검색을 시작할 row의 index를 설정
- nEndIdx: Dataset에서 검색을 종료할 row의 index에서 1을 더한 값 설정
음수값이나 -1 설정시 마지막 row까지 검색
- 일치하는 데이터가 없는 경우 -1을 반환
4) Grid.getEditValue()
- cell이 편집모드일 때 표시되는 컨트롤의 value 속성값을 반환
- grid의 edittype값이 button, checkbox, tree 면 undefined 반환
- grid의 edittype값이 combo, date 면 undefined 반환
예)
this.grdList_onkeyup = function(obj:nexacro.Grid,e:nexacro.KeyEventInfo) {
trace("키가 눌린 인덱스:: "+obj.getCellPos());
if(obj.getCellPos() == 2){
if(this.dsList.findRow("mngmDeptCd", obj.getEditValue()) != -1){
this.gfnAlert("MSG00000150", ["중복된 값이 존재"]);
}
}
};
| cs |