Skip to main content

resetLayout

Description

Rebuilds the Gantt layout using the current value of the layout config

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

note

This method removes custom layers added to the timeline area via the addTaskLayer and addLinkLayer methods. Therefore, you need to redefine these ones after calling the gantt.resetLayout method in order for custom layers to be displayed on a page.

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.