翻譯|使用教程|編輯:秦林|2022-09-29 10:42:36.300|閱讀 204 次
概述:這篇文章給大家講解如何在服務器上使用dhtmlxGantt。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
這篇文章給大家講解如何在服務器上使用dhtmlxGantt。
在某些情況下,您可能需要與甘特圖分開使用dhtmlxGantt的專門邏輯,例如:
出于這個原因,我們提供了一個單獨的dhtmlxGantt構建,它可以在Node.js環境中的服務器端運行。
Node.js 的 DHTMLX Gantt 具有與 Commercial/Enterprise/Ultimate 包相同的功能,這意味著Gantt.getGanttInstance方法可用并允許創建甘特圖的新實例。
dhtmlxGantt適用于Node.js包的版本編號方案與瀏覽器包相同(例如,v7.0.0 是 Node.js 包的甘特圖的第一個版本)。
您可以將Node.js的dhtmlxGantt安裝為本地包:
"dependencies": { "@dhtmlx/gantt-node": "file:../../gantt_7.0.0_node" ... }
或者您可以直接從您的代碼中導入dhtmlxgantt.node.js,如下所示:
import { Gantt } from "@dhtmlx/gantt-node"; const gantt = Gantt.getGanttInstance({ plugins:{ auto_scheduling: true, }, config: { work_time: true, duration_unit: "hour", auto_scheduling: true, auto_scheduling_strict: true, auto_scheduling_initial: false }, data: { tasks: [ { id: 1, text: "Project #1", type: "project", parent: 0 }, { id: 2, start_date: "05-04-2020 00:00", text: "Task #1", duration: 1, parent: 1, type: "task" }, { id: 3, start_date: "05-04-2020 00:00", text: "Task #2", duration: 3, parent: 1, type: "task" }, { id: 4, start_date: "05-04-2020 00:00", text: "Task #3", duration: 3, parent: 1, type: "task" }, { id: 5, start_date: "05-04-2020 00:00", text: "Task #4", duration: 3, parent: 1, type: "task" }, { id: 6, start_date: "05-04-2020 00:00", text: "Task #5", duration: 1, parent: 1, type: "task" } ], links: [ { id: 1, source: 1, target: 2, type: "0" }, { id: 2, source: 2, target: 3, type: "0" }, { id: 3, source: 3, target: 4, type: "0" }, { id: 4, source: 4, target: 5, type: "0" }, { id: 5, source: 5, target: 6, type: "0" } ] }, events:{ onAfterAutoSchedule: function(taskId, updatedTasks) { console.log("Following tasks were auto scheduled:"); console.table(updatedTasks.map((taskId) => { return { id: taskId, text: this.getTask(taskId).text }; })); }, onParse: function() { console.log("Loaded data:") console.table(this.serialize().data); }, onGanttReady: () => { console.log("Running dhtmlxGantt on the backend"); } } }); console.table(gantt.serialize());
dhtmlxGantt是用于跨瀏覽器和跨平臺應用程序的功能齊全的Gantt圖表,可滿足項目管理控件應用程序的所有需求,是最完善的甘特圖圖表庫。了解更多DhtmlxGantt相關內容和資訊,歡迎在線咨詢或者私信我獲取正版試用版及報價。
甘特圖控件交流群:764148812 歡迎進群交流討論
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn