목차

그리드 행 상태열 가이드

그리드 컴포넌트 행 상태열에 대한 예시 화면이다.

그리드 행 상태는 NONE(NORMAL)/INSERT/UPDATE/DELETE 상태를 가진다.

행 상태열은 그리드 행 상태를 자동으로 표시하기 위한 컬럼이다.

관련 속성으로는 use_statusrow, statusrow_displaymode, statusrow_title, statusrow_width, statusrow_resizable가 있다.

관련 API로는 getrowoperation, setrowoperation, setallrowoperation이 있다.

예시

템플릿 위치: /HTML5/COMPONENT/GRID/grid_statusrow_basic

템플릿 파일

화면 스크립트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// 화면 로드 이벤트
function screen_on_load()
{
    // 그리드 선택행 지정
    this.grdList.setselectrow(0);
 
    // 모든 행의 초기 상태를 "NORMAL"로 설정
    this.grdList.setallrowoperation(XFD_ROWOP_NONE);
}
 
// "deleterow" 버튼 이벤트
function btn_deleterow_on_click(objInst)
{
    var row_index;
 
    // 선택된 행 인덱스를 구함
    row_index = this.grdList.getselectrow();
 
    // 선택된 행 삭제/삭제 마크 처리
    this.grdList.deleterow(row_index, true, this.chk_del_mark.getcheck());
}
 
// "getrowoperation" 버튼 이벤트
function btn_getrowoperation_on_click(objInst)
{
    var row_index, row_op;
 
    // 선택된 행 인덱스를 구함
    row_index = this.grdList.getselectrow();
 
    // 선택한 행 상태를 구함
    row_op = this.grdList.getrowoperation(row_index);
 
    // 선택된 행 상태 표시
    fld_rowop.settext(row_op);
    screen.alert(row_index + "행 상태코드 = [" + row_op + "]");
}
 
// "setitemtext" 버튼 이벤트
function btn_setitemtext_on_click(objInst)
{
    var row_index, column_index;
 
    // 선택된 행/열 인덱스를 구함
    row_index = this.grdList.getselectrow();
    column_index = this.grdList.getselectcolumn();
 
    // 선택된 아이템의 값을 설정
    this.grdList.setitemtext(row_index, column_index, "NEW");
}
 
// "setrowoperation" 버튼 이벤트
function btn_setrowoperation_on_click(objInst)
{
    var row_index, row_op;
 
    // 선택된 행 인덱스를 구함
    row_index = this.grdList.getselectrow();
 
    // 지정할 행 상태 코드를 구함
    row_op = this.cbo_rowop.getselectedcode();
 
    // 선택된 행의 상태 설정
    this.grdList.setrowoperation(row_index, row_op);
}
 
// "setallrowoperation" 버튼 이벤트
function btn_setallrowoperation_on_click(objInst)
{
    var row_op;
 
    // 지정할 행 상태 코드를 구함
    row_op = this.cbo_rowopall.getselectedcode();
 
    // 전체 행 상태 설정
    this.grdList.setallrowoperation(row_op, true);
}
 
// "addrow" 버튼 이벤트
function btn_addrow_on_click(objInst)
{
    // 행 추가
    this.grdList.addrow();
}
 
// "refresh" 버튼 이벤트
function btn_refresh_on_click(objInst)
{
    // 그리드 내용 다시 표시
    this.grdList.refresh();
}