이 컨트롤은 한 번에 하나만 선택할 수 있는 여러 옵션을 제공합니다.
라이트박스에 radio button 컨트롤을 포함하려면 다음과 같이 설정합니다:
1) 라이트박스 설정에 섹션을 추가합니다:
var opts = [
{key: 1, label: "High"},
{key: 2, label: "Normal"},
{key: 3, label: "Low"}
];
gantt.config.lightbox.sections = [
{name: "description", height: 38, map_to: "text", type: "textarea", focus: true},
{name: "priority", height: 22, map_to: "priority", type: "radio", options: [opts]}, {name: "time", type: "duration", map_to: "auto"}
];
2) 이 섹션에 대한 라벨을 정의합니다:
gantt.locale.labels.section_priority = "Priority";
radio button 컨트롤에서 자주 사용되는 주요 속성은 다음과 같습니다 (전체 목록은 여기에서 확인할 수 있습니다):
radio button 컨트롤의 옵션을 지정하려면 options 파라미터를 사용합니다:
gantt.config.lightbox.sections = [
{name: "priority", map_to: "priority", type: "radio", options: [
{key: 1, label: "High"},
{key: 2, label: "Normal"},
{key: 3, label: "Low"},
]}
];
options 배열의 각 항목에는 두 가지 속성이 필요합니다: