일정관리 기본 가이드
스케줄 컴포넌트는 달력 기반으로 메모를 추가/표시하기 위한 컴포넌트이다.
관련 속성으로 item_style가 있다.
관련 API로 setdate, additem, deleteitembyindex, refresh가 있다.
관련 이벤트로 on_enddrag, on_itemselectdate가 있다.
예시
템플릿 위치: /HTML5/COMPONENT/SCHEDULE/schedule_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 |
function screen_on_load() { // 일정 정보를 추가 this .btn_additem_on_mouseup(); } // 아이템 유형 변경 이벤트 function cboItemStyle_on_itemchange(objInst, nprev_item, ncur_item) { this .schedule.setitemstyle( this .cboItemStyle.getselectedcode()); } // 일자 변경 이벤트 function fldDate_on_change(objInst) { var yyyymm = this .fldDate.gettext(); this .schedule.setdate(yyyymm); } // additem 버튼 이벤트 function btn_additem_on_mouseup(objInst) { var ret; var yyyymm; yyyymm = this .fldDate.gettext(); factory.consoleprint( this .fldDate.gettext()); // schedule.additem("20180904", "GLOBAL_KEY_2", "색상", 1, null, null); this .schedule.additem(yyyymm + "03" , "KEY_1" , "단순 일정" , "" , "" , null , null , false ); this .schedule.additem(yyyymm + "04" , "KEY_2" , "작업 완료" , "" , "/BIZ/accd_avg.jpg" , null , null , false ); this .schedule.additem(yyyymm + "05" , "KEY_3" , "진행중 일정" , "" , "/BIZ/accd_max.jpg" , null , null , false ); this .schedule.additem(yyyymm + "06" , "KEY_A" , "일정A" , "" , "/BIZ/accd_min.jpg" , null , null , false ); this .schedule.additem(yyyymm + "06" , "KEY_B" , "일정B" , "" , "/BIZ/accd_min.jpg" , null , [255, 111, 0], false ); this .schedule.additem(yyyymm + "06" , "KEY_C" , "일정C" , "" , "/BIZ/accd_min.jpg" , null , null , false ); this .schedule.refresh(); } // 스케쥴 아이템 드래그 종료 이벤트 function schedule_on_enddrag(objInst, strDropDate, strDate, nIndex, strKey, strTitle, strMemo, strImage) { this .schedule.deleteitembyindex(strDate, nIndex); this .schedule.additem(strDropDate, strKey, strTitle, strMemo, strImage, null , null , true ); } // 아이템 확장 버튼 드래그 종료 이벤트 function schedule_on_itemselectdate(objInst, strStartDate, strEndDate, strDate, nIndex, strKey, strTitle, strMemo, strImage) { var nStartDate, nEndDate, nItemDate, i; nStartDate = parseInt(strStartDate, 10); nEndDate = parseInt(strEndDate, 10); nItemDate = parseInt(strDate, 10); for (i = nStartDate; i <= nEndDate; i++) { if (i == nItemDate) { continue ; } this .schedule.additem(i, strKey, strTitle, strMemo, strImage, null , null , false ); } this .schedule.refresh(); } |