翻譯|使用教程|編輯:秦林|2022-10-25 09:32:32.220|閱讀 350 次
概述:本文給大家講解dhtmlxGantt如何突出展示時(shí)間段。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
本文給大家講解dhtmlxGantt如何突出展示時(shí)間段。
為了讓用戶(hù)注意特定的時(shí)間段,您可以突出顯示它們。
模板是一個(gè)函數(shù),它遍歷所有日期并將指定的 CSS 類(lèi)應(yīng)用于相關(guān)單元格。
例如,您可以突出顯示周末以直觀地將比例劃分為周:
<style> .weekend{ background: #f4f7f4 !important;} </style> gantt.templates.scale_cell_class = function(date){ if(date.getDay()==0||date.getDay()==6){ return "weekend"; } }; gantt.templates.timeline_cell_class = function(task,date){ if(date.getDay()==0||date.getDay()==6){ return "weekend" ; } }; gantt.init("gantt_here");
請(qǐng)注意,在使用工作時(shí)間計(jì)算時(shí),您可以使用isWorkTime而不是硬編碼值:
gantt.config.work_time = true; gantt.templates.scale_cell_class = function(date){ if(!gantt.isWorkTime(date)){ return "weekend"; } }; gantt.templates.timeline_cell_class = function(task,date){ if(!gantt.isWorkTime({task:task, date:date})){ return "weekend" ; } }; gantt.init("gantt_here");
dhtmlxGantt享有超十年聲譽(yù),支持跨瀏覽器和跨平臺(tái),性?xún)r(jià)比高,可滿(mǎn)足項(xiàng)目管理控件應(yīng)用的所有需求,是最完善的甘特圖圖表庫(kù)。了解更多內(nèi)容,歡迎在線(xiàn)咨詢(xún)或者私信我獲取正版試用版及報(bào)價(jià)。
甘特圖控件交流群:764148812 歡迎進(jìn)群交流討論
慧都年終狂歡季,全場(chǎng)產(chǎn)品,限時(shí)特惠,立即了解詳情!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn