项目管理软件dhtmlxGantt配置教程(二):调整网格行大小

这篇文章给大家讲解dhtmlxGantt如何调整网格的行大小。

可以更改网格中单独行的高度,dhtmlxGantt 库提供了两种管理行高的方法:

  • 通过为必要的任务对象设置行的高度和任务栏的高度;
  • 通过拖动网格行的底部边框。
gantt.config.columns = [    {name:"wbs", label:"WBS", width:40, template:gantt.getWBSCode },    {name:"text", label:"Task name", tree:true, width:170 },    {name:"start_date", align:"center", width: 90},    {name:"duration", align:"center", width: 60},    {name:"add", width:40}];
设置行高

您可以根据需要调整特定行的高度。

项目管理软件dhtmlxGantt配置教程(二):调整网格行大小

为此,您需要重新定义 的row_height 和 bar_height属性: 数据集中任务对象

gantt.parse({    data: [        { id: 11, text: "Project #1", type: "project", progress: 0.6, open: true,            row_height: 70, bar_height: 60 },        { id: 12, text: "Task #1", start_date: "03-04-2018", duration: "5",            parent: "11", progress: 1, open: true },        { id: 13, text: "Task #2", start_date: "03-04-2018", type: "project",            parent: "11", progress: 0.5, open: true }    ],    links: []});

或者您可以动态实现它:

gantt.getTask(11).row_height = 50;gantt.getTask(11).bar_height = 25;// re-render Gantt to apply the changesgantt.render();
通过拖放调整行大小

项目管理软件dhtmlxGantt配置教程(二):调整网格行大小

要让用户可以通过拖动行的底部边框来调整网格中的行大小,请将 gantt.config.resize_rows 选项设置为 true :

gantt.config.resize_rows = true;

gantt.config.min_task_grid_row_height : 选项提供了定义在调整大小期间可以为任务设置的最小行高的能力

gantt.config.min_task_grid_row_height = 45;

dhtmlxGantt是用于跨浏览器和跨平台应用程序的功能齐全的Gantt图表,可满足项目管理控件应用程序的所有需求,是最完善的甘特图图表库。了解更多DhtmlxGantt相关内容和资讯,欢迎在线咨询或者私信我获取正版试用版及报价。


甘特图控件交流群:764148812    欢迎进群交流讨论

更多正版甘特图软件下载、购买、授权咨询,请点这里!

标签:

来源:慧都网

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2022年9月10日
下一篇 2022年9月10日

相关推荐

发表回复

登录后才能评论