본문으로 건너뛰기

체크박스 제어

두 상태의 체크박스. 이 컨트롤은 옵션 하나 또는 여러 값의 켜기/끄기를 전환하는 데 사용됩니다.

예를 들어, 다음에 유용합니다:

체크박스 컨트롤

체크박스 컨트롤

분할 작업 체크박스

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"}
];

분할 작업

Initialization

Lightbox에 checkbox 컨트롤을 추가하려면 아래 단계를 따릅니다:

  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"}
];
  1. 섹션의 레이블 설정:
gantt.locale.labels.section_split = "Display";

분할 작업

Properties

다음 속성은 주로 중요하고 일반적으로 checkbox 컨트롤에 대해 설정됩니다(전체 목록은 여기를 참조하세요):

  • name - (string) 섹션 이름
  • map_to - (string) 섹션에 매핑될 데이터 속성의 이름
  • type - (string) 섹션 컨트롤의 유형
  • options - (array) 객체 배열. 컨트롤의 선택 옵션을 정의합니다 (선택, 체크박스 및 라디오 컨트롤에 사용됨). 배열의 각 객체는 단일 옵션을 지정하며 다음 속성을 가집니다:
    • key - (string) 옵션 ID. 이 속성은 작업 데이터 속성과 비교되어 작업에 옵션을 할당합니다
    • label - (string) 옵션 레이블
  • focus - (boolean) true로 설정되면, 라이트박스를 열 때 해당 섹션에 포커스가 설정됩니다
  • default_value - (any) 섹션 컨트롤의 기본값. 입력 값이 정의되지 않은 경우에만 적용됩니다

데이터로 컨트롤 채우기

일반적으로 checkbox 컨트롤의 값을 설정하려면 options 매개변수를 사용합니다:

gantt.config.lightbox.sections = [
{name: "split", type:"checkbox", map_to: "render", options:[
{key:"split", label:"Split Task"}
]}
];

options 매개변수의 항목에는 2개의 필수 속성이 있습니다:

  • key - 옵션 ID
  • label - 옵션 레이블
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.