Units View
정보
이 뷰는 Scheduler PRO 버전에서만 사용할 수 있습니다.
Units 뷰는 X축을 단순히 시간 기준이 아닌, 이벤트의 특정 속성을 기준으로 구성합니다.

초기화
스케줄러에 Units 뷰를 추가하려면 다음 단계를 따르세요:
- 페이지에서 Units 확장 기능을 활성화하세요:
scheduler.plugins({
units: true
});
- 스케줄러 마크업에 뷰의 탭을 추가하세요:
<div id="scheduler_here" class="dhx_cal_container" ...>
<div class="dhx_cal_navline">
...
<div class="dhx_cal_tab" name="unit_tab"></div>
</div>
...
</div>
- 탭의 라벨을 설정하세요:
//'unit_tab'은 div의 이름입니다
scheduler.locale.labels.unit_tab = "Unit"
- createUnitsView 메서드를 사용하여 뷰를 생성하세요:
scheduler.createUnitsView({
name:"unit",
property:"unit_id", // 유닛에 매핑할 이벤트 속성
list:[ // 뷰에 표시할 유닛 정의
{key:1, label:"Section A"},
{key:2, label:"Section B"},
{key:3, label:"Section C"}
]
});
뷰에 데이터 로딩하기
Day, Month, Year와 같은 표준 뷰와 달리, Units와 Timeline과 같은 다중 리소스 뷰는 이벤트에 추가 필드가 반드시 필요합니다:
- property - (string) 이벤트를 특정 유닛에 할당할 때 사용하는 데이터 속성의 이름
scheduler.createUnitsView({
name:"unit",
property:"unit_id",
list:[
{key:1, label:"Section A"},
{key:2, label:"Section B"},
{key:3, label:"Section C"}
]
});
scheduler.init('scheduler_here');
scheduler.parse([
{id:1, text:"Task1", start_date:"2019-09-17 12:00", end_date:"2019-09-18 21:00",
unit_id:"1"},
{id:2, text:"Task2", start_date:"2019-09-17 09:00", end_date:"2019-09-17 21:00",
unit_id:"3"},
{id:3, text:"Task3", start_date:"2019-09-17 15:00", end_date:"2019-09-18 15:00",
unit_id:"2"}
]);
이벤트는 unit_id 값과 list.key가 일치할 때 해당 유닛에 할당됩니다.
섹션 동적 변경
Units 뷰에서 유닛 목록을 동적으로 갱신하려면 serverList 및 updateCollection 메서드를 사용할 수 있습니다.