트리그리드 트리아이템 추가 가이드

트리그리드의 트리 아이템 추가 기능에 대한 예시 화면이다.

트리그리드의 행은 자식인 있는 행과 자식이 없는 행(Leaf-Row)로 구분된다.

관련 API로는 addtreeitem, inserttreeitem이 있다.

템플릿 위치: /HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd

템플릿 파일

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
// "addtreeitem" 버튼 이벤트
function btn_addtreeitem_on_click(objInst)
{
    var row_index;
    row_index = this.grd.getrowcount();
    this.grd.addtreeitem(row_index + "행", 0, 0, "", -1, false, false);
    this.grd.setitemtextex(row_index, 1, row_index, false);
    this.grd.refresh();
}
 
// "addtreeitem child" 버튼 이벤트
function btn_addtreeitem_child_on_click(objInst)
{
    var row_index;
    row_index = this.grd.getrowcount();
    this.grd.addtreeitem(row_index + "행", 0, 0, "", -1, true, false);
    this.grd.setitemtextex(row_index, 1, row_index, false);
    this.grd.refresh();
}
 
// "inserttreeitem" 버튼 이벤트
function btn_inserttreeitem_on_click(objInst)
{
    var row_index;
    row_index = this.grd.getselectrow();
    if (row_index < 0) { row_index = 0; }
 
    this.grd.inserttreeitem(row_index, row_index + "행", 0, 0, "", -1, false, false);
    this.grd.setitemtextex(row_index, 1, row_index, false);
    this.grd.refresh();
}
 
// "inserttreeitem child" 버튼 이벤트
function btn_inserttreeitem_child_on_click(objInst)
{
    var row_index;
    row_index = this.grd.getselectrow();
    if (row_index < 0) { row_index = 0; }
 
    this.grd.inserttreeitem(row_index, row_index + "행", 0, 0, "", -1, true, false);
    this.grd.setitemtextex(row_index, 1, row_index, false);
    this.grd.refresh();
}

  • guide/component/treegrid/treegrid_treeitemadd.txt
  • 마지막으로 수정됨: 2024/02/22 14:36
  • 저자 127.0.0.1