이것은 옵션이나 여러 값을 켜고 끄는 데 사용되는 간단한 2-상태 체크박스 컨트롤입니다.
다음과 같은 상황에서 유용하게 사용할 수 있습니다:
Related sample: Checkbox control
gantt.config.lightbox.project_sections = [
{name: "description", height: 70, map_to: "text", type: "textarea", focus: true},
{name: "split", type:"checkbox", map_to: "render", options:[ {key:"split", label:"Split Task"} ]}, {name: "time", type: "duration", readonly: true, map_to: "auto"}
];
checkbox 컨트롤을 lightbox에 포함하려면 다음 단계를 따라야 합니다:
1) lightbox 설정에 섹션을 추가합니다:
var opts = [
{key:"split", label:"Split Task"}
];
gantt.config.lightbox.sections = [
{name: "description", height: 70, map_to: "text", type: "textarea", focus: true},
{name: "split", type:"checkbox", map_to: "render", options:opts}, {name: "time", type: "duration", readonly: true, map_to: "auto"}
];
2) 해당 섹션에 라벨을 정의합니다:
gantt.locale.labels.section_split = "Display";
checkbox 컨트롤과 함께 자주 사용되는 주요 속성은 다음과 같습니다 (전체 목록은 여기에서 확인할 수 있습니다):
checkbox 컨트롤의 값을 설정하려면 일반적으로 options 파라미터를 사용합니다:
gantt.config.lightbox.sections = [
{name: "split", type:"checkbox", map_to: "render", options:[
{key:"split", label:"Split Task"}
]}
];
options 배열의 각 항목에는 다음 두 속성이 반드시 포함되어야 합니다: