Zum Hauptinhalt springen

load

Description

Lädt Daten in das Gantt-Diagramm aus einer externen Datenquelle

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

Parameters

  • url - (erforderlich) string - die serverseitige URL (kann eine statische Datei oder ein serverseitiges Script sein, das Daten ausgibt)
  • type - (optionaL) string ('json', 'xml', 'oldxml') - der Datentyp. Der Standardwert - 'json'
  • callback - (optionaL) function - die Callback-Funktion

Returns

  • resultPromise - (object) - das Promise-Objekt, das sich auflöst, wenn die AJAX-Anfrage abgeschlossen ist

Example

gantt.load("/data",function(){
gantt.message("everything is ready");
});
//oder
gantt.load("/data").then(function(xhr){
gantt.message("everything is ready");
});
//oder
gantt.load("data.json"); //Laden von Daten im JSON-Format
//oder
gantt.load("data.xml","xml"); //Laden von Daten im XML-Format (Version 2.0+)
//oder
gantt.load("data.xml","xml", function(){ //Callback-Funktion angeben
alert("Data has been successfully loaded");
});

Details

Die Methode löst die Ereignisse onLoadStart und onLoadEnd aus.

Hinweis

Beachten Sie, dass die Methode in der Gantt-Version für Node.js nicht funktioniert.

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.