이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요. ====== 트리그리드 트리아이템 추가 가이드 ====== 트리그리드의 트리 아이템 추가 기능에 대한 예시 화면이다. 트리그리드의 행은 자식인 있는 행과 자식이 없는 행(Leaf-Row)로 구분된다. 관련 API로는 addtreeitem, inserttreeitem이 있다. ===== 예시 ===== 템플릿 위치: /HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd 템플릿 파일 * [[xf5projecthome>template/screen/HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd.xml|treegrid_treeitemadd.xml]] * [[xf5projecthome>template/screen/HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd.js|treegrid_treeitemadd.js]] * [[xf5projecthome>template/template.html?xframe_screen_url=/HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd|새창으로 실행]] <php> echo '<html>'; echo '<iframe src="'; echo $conf['plugin']['xf5']['xf5projecthome'], 'template/template.html?'; echo 'xframe_screen_url=/HTML5/COMPONENT/TREEGRID/treegrid_treeitemadd"'; echo ' class="_xf5_iframe"'; echo ' style="'; echo $conf['plugin']['xf5']['xf5iframestyle']; echo '">'; echo '</iframe>'; echo '</html>'; </php> ==== 화면 스크립트 ==== <sxh javascript> // "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(); } </sxh> guide/component/treegrid/treegrid_treeitemadd.txt 마지막으로 수정됨: 2024/02/22 14:36저자 127.0.0.1