翻譯|使用教程|編輯:秦林|2022-09-30 10:20:42.333|閱讀 232 次
概述:這篇文章給大家講解如何利用dhtmlxGantt加載任務日期。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
這篇文章給大家講解如何利用dhtmlxGantt加載任務日期。
設置任務計劃
可以通過三種方式為數據饋送中的任務定義計劃:
未指定的屬性將根據數據對象中定義的屬性進行計算。
end_date的優先級高于duration參數。如果任務對象中指定了3個參數,甘特圖將忽略持續時間參數,任務將加載不同的持續時間值。例如:
{ "id":"20", "text":"Project #2", "start_date":"01-04-2025", "duration":3, "end_date":"05-04-2025", "order":10,"progress":0.4, "type": "project", "open": true } // the task above will be loaded with the duration value calculated in accordance // with the specified 'start_date' and 'end_date' { "id":"20", "text":"Project #2", "start_date":"01-04-2025", "duration":4, "end_date":"05-04-2025", "order":10,"progress":0.4, "type": "project", "open": true }
您可以在甘特圖中使用ISO日期格式。為此,您需要重新定義在甘特圖中解析和序列化日期的函數:
gantt.templates.parse_date = function(date) { return new Date(date); }; gantt.templates.format_date = function(date) { return date.toISOString(); };
dhtmlxGantt是用于跨瀏覽器和跨平臺應用程序的功能齊全的Gantt圖表,可滿足項目管理控件應用程序的所有需求,是最完善的甘特圖圖表庫。了解更多DhtmlxGantt相關內容和資訊,歡迎在線咨詢或者私信我獲取正版試用版及報價。
甘特圖控件交流群:764148812 歡迎進群交流討論
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn