그리드 input_type 속성 가이드
그리드 데이터부의 input_type 속성 값 유형 예시 화면이다.
그리드 데이터부의 input_type 속성은 컬럼 데이터부에 데이터를 표시하는 방식을 설정한다.
관련 속성으로 input_type이 있다.
관련 API로 getcolumninputtype. setcolumninputtype, getiteminputtype, setiteminputtype이 있다.
예시
템플릿 위치: /HTML5/COMPONENT/GRID/grid_inputtype_basic
템플릿 파일
화면 스크립트
// "setcolumninputtype" 버튼 이벤트
function btn_setcolumninputtype_on_click(objInst)
{
var input_type;
input_type = this.grd.getcolumninputtype(0);
// input_type이 editbox인 경우, calendar로 변경
if (input_type == 0) {
this.grd.setcolumninputtype(0, 3);
this.grd.setheadertext(1, 0, "calendar");
}
// input_type이 editbox가 아닌 경우, editbox로 변경
else {
this.grd.setcolumninputtype(0, 0);
this.grd.setheadertext(1, 0, "editbox");
}
// 변경된 컬럼 input_type 표시
this.grd.refresh();
}
// "setiteminputtype" 버튼 이벤트
function btn_setiiteminputtype_on_click(objInst)
{
var input_type;
// 아이템별 input_type을 구함
input_type = this.grd.getiteminputtype(1, 0);
// 아이템별 input_type 미지정 상태인 경우, 컬럼의 input_type을 구함
if (input_type == -1) { input_type = this.grd.getcolumninputtype(0); }
// input_type이 editbox인 경우, calendar로 변경
if (input_type == 0) {
this.grd.setiteminputtype(1, 0, 3);
}
// input_type이 editbox가 아닌 경우, editbox로 변경
else {
this.grd.setiteminputtype(1, 0, 0);
}
}