이 컨트롤은 일부 HTML 콘텐츠를 내부에 포함하는 컨테이너입니다.
gantt.config.lightbox.sections = [
{name:"description", height:38, map_to:"text", type:"textarea", focus:true},
{name:"template", height:16, type:"template", map_to:"my_template"}, {name:"time", height:72, type:"duration", map_to:"auto"}
];
gantt.locale.labels.section_template = "Details";
gantt.attachEvent("onBeforeLightbox", function(id) {
var task = gantt.getTask(id);
task.my_template = "<span id='title1'>Holders: </span>"+ task.users
+"<span id='title2'>Progress: </span>"+ task.progress*100 +" %";
return true;
});
Related sample: Template control
template 컨트롤을 라이트박스에 포함하려면 다음 단계를 따라야 합니다:
1) 라이트박스 설정에 섹션을 추가합니다:
gantt.config.lightbox.sections = [
{name:"description", height:38, map_to:"text", type:"textarea", focus:true},
{name:"template", height:16, type:"template", map_to:"my_template"}, {name:"time", height:72, type:"duration", map_to:"auto"}
];
2) 섹션에 대한 라벨을 정의합니다:
gantt.locale.labels.section_template = "Details";
3) onBeforeLightbox 이벤트와 같은 이벤트를 사용하여 컨트롤의 콘텐츠를 채웁니다:
gantt.attachEvent("onBeforeLightbox", function(id) {
var task = gantt.getTask(id);
task.my_template = "<span id='title1'>Holders: </span>"+ task.users
+"<span id='title2'>Progress: </span>"+ task.progress*100 +" %";
return true;
});
template 컨트롤에서 자주 사용되는 주요 속성은 다음과 같습니다 (전체 목록은 여기를 참고하세요):