konvertiert eine XML- oder XER-Datei von Primavera P6 in das JSON-Format
config | object | ein Objekt, das Konfigurationsoptionen für die importierte Datei enthält |
gantt.importFromPrimaveraP6({
data: file,
taskProperties: ["Notes", "Name"],
callback: function (project) {
if (project) {
gantt.clearAll();
if (project.config.duration_unit) {
gantt.config.duration_unit = project.config.duration_unit;
}
gantt.parse(project.data);
}
}
});
Die Methode erfordert Unterstützung für die HTML5 File API.
Diese Methode ist Teil der export-Erweiterung, daher muss das Plugin export_api aktiviert sein. Weitere Details finden Sie im Artikel Export und Import aus Primavera P66.
Für Gantt-Versionen vor 8.0 muss https://export.dhtmlx.com/gantt/api.js auf Ihrer Seite eingebunden werden, um den Online-Export-Service zu aktivieren, zum Beispiel:
<script src="codebase/dhtmlxgantt.js"></script>
<script src="https://export.dhtmlx.com/gantt/api.js"></script>
Diese Methode akzeptiert ein Objekt mit Konfigurationsoptionen für die importierte Datei:
Die Antwort ist ein JSON-Objekt mit folgender Struktur:
{
data: {},
config: {},
resources: [],
worktime: {}
}