본문으로 건너뛰기

load

Description

외부 데이터 소스에서 간트 차트로 데이터를 로드합니다

load: (url: string, type?: string, callback?: GanttCallback) => any

Parameters

  • url - (required) string - 서버 측 URL(정적 파일 또는 데이터를 출력하는 서버 사이드 스크립트일 수 있습니다)
  • type - (optionaL) string ('json', 'xml', 'oldxml') - 데이터 타입. 기본값 - 'json'
  • callback - (optionaL) function - 콜백 함수

Returns

  • resultPromise - (object) - AJAX 요청이 완료될 때 해결되는 프라미스 객체

Example

gantt.load("/data",function(){
gantt.message("everything is ready");
});
//또는
gantt.load("/data").then(function(xhr){
gantt.message("everything is ready");
});
//또는
gantt.load("data.json"); //JSON 포맷으로 데이터를 로딩
//또는
gantt.load("data.xml","xml"); //XML 포맷으로 데이터를 로딩(버전 2.0+)
//또는
gantt.load("data.xml","xml", function(){ //콜백 함수를 지정
alert("Data has been successfully loaded");
});

Details

이 메서드는 onLoadStartonLoadEnd 이벤트를 트리거합니다.

노트

참고: 이 메서드는 Node.js용 Gantt 버전에서 작동하지 않습니다.

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.