跳到主要内容

resetLayout

Description

使用当前布局配置重新构建甘特图布局

resetLayout: () => void

Example

gantt.init("gantt_here");

gantt.config.layout = {
css: "gantt_container",
rows: [
{
cols: [
{view: "grid", scrollX: "scrollHor", scrollY: "scrollVer"},
{resizer: true, width: 1},
{view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer"},
{view: "scrollbar", id: "scrollVer"}
]
},
{view: "scrollbar", id: "scrollHor", height: 20}
]
};

gantt.resetLayout();

Details

注释

此方法会移除通过 addTaskLayeraddLinkLayer 方法添加到时间线区域的自定义图层。 因此,在调用 gantt.resetLayout 方法之后,您需要重新定义这些自定义图层,才能在页面上显示它们。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.