본문으로 건너뛰기

resources

Description

리소스 저장소에 대한 추가 구성을 정의합니다

resources: boolean | { dataprocessor_assignments?: boolean; dataprocessor_resources?: boolean; editable_resource_diagram?: boolean; resource_store?: { type?: string; initItem?: ((item: any) => any); fetchTasks?: boolean; }; lightbox_resources?(resourceArray: any): any; }

Example

gantt.config.resources = {
dataprocessor_assignments: true,
dataprocessor_resources: true,
editable_resource_diagram: true,
resource_store: {
type: "treeDataStore",
fetchTasks: true,
initItem: function(item) {
item.parent = item.parent || gantt.config.root_id;
item[gantt.config.resource_property] = item.parent;
item.open = true;
return item;
}
},
lightbox_resources: function selectResourceControlOptions(resources){
const lightboxOptions = [];
resources.forEach(function(res) {
if (!gantt.$resourcesStore.hasChild(res.id)) {
const copy = gantt.copy(res);
copy.key = res.id;
copy.label = res.text;
lightboxOptions.push(copy);
}
});
return lightboxOptions;
}
};

Details

The resources property presents an object with a set of attributes:

  • dataprocessor_assignments - (boolean) - 수정된 리소스 할당을 지속 가능한 ID를 가진 별도 항목으로 DataProcessor에 보낼 수 있는지 정의합니다
  • dataprocessor_resources - (boolean) - 수정된 리소스 객체를 지속 가능한 ID를 가진 별도 항목으로 DataProcessor에 보낼 수 있는지 정의합니다
  • editable_resource_diagram - (boolean) - 리소스 다이어그램에서 리소스 할당을 편집 가능하게 할지 정의합니다
  • resource_store - (object) - 기본 리소스 데이터스토어를 생성합니다. 이 객체에는 다음 속성이 포함됩니다:
    • type? - (string) - 선택적이며 하나의 고정 값 **"treeDatastore"**만 허용합니다. type:"treeDatastore"가 지정되면 데이터스토어는 계층 데이터를 지원하고, id 속성을 기본 키로 사용하며 parent를 부모 id에 대한 연결로 사용합니다. 다른 값은 평면 목록 데이터스토어를 생성합니다.
    • initItem? - (Function): any - 선택적이며, 데이터스토어에 로드된 아이템을 전처리합니다. 데이터스토어 아이템의 기본 값을 설정하기에 적합한 위치입니다. 함수는 다음 매개변수를 받습니다:
      • item - (any) - 리소스 아이템
    • fetchTasks? - (boolean) - 선택적이며, 특정 리소스에 할당된 모든 작업을 리소스 보기 패널에 표시하도록 활성화합니다. 이 기능은 리소스 다이어그램 및 리소스 히스토그램 레이아웃 타입 모두에서 작동합니다.
  • lightbox_resources? (resourceArray): any - 선택적이며, 모든 리소스를 인수로 받아 lightbox의 리소스 컨트롤에서 사용할 수 있어야 하는 리소스 배열을 반환하는 함수입니다. 기본적으로 컨트롤은 하위 리소스가 없는 리소스로 채워집니다.
    • resourceArray - (any) - 리소스 배열

Change log

  • v8.0에 추가됨
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.