Hi,
Gantt still allocates space for a scroll bar in the layout, even then the actual scrollbar is hidden via css.
I think you can do a small workaround to bypass this - you redefine the layout config and wrap the scrollbar cell with another container and set the height of that container to 1px (the config doesn’t accept zero height).
Then, if you hide that element via css, the empty area will be only 1px, which should be much better then what you have now.
gantt.config.layout = {
css: "gantt_container",
rows: [
{
css: "top-gantt-layout",
cols: [
{view: "grid", scrollX: "scrollHor", scrollY: "scrollVer"},
{resizer: true, width: 1},
{view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer"},
{view: "scrollbar", id: "scrollVer"}
]
},
{
css: "hidden-scrollbar",
height: 1,
rows:
[
{view: "scrollbar", id: "scrollHor"}
]
}
]
}
Live demo: http://snippet.dhtmlx.com/30e0c2e06
Alternatively, you could just remove the horozintal scrollbar from the layout config https://docs.dhtmlx.com/gantt/desktop__layout_config.html#defaultlayout:
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"}
]
}
]
};
http://snippet.dhtmlx.com/3e89d00b2
However, but this would disable horizontal scrolling in the upper gantt chart completely, meaning that you wouldn’t be to change the position of horizontal scroll via gantt.scrollTo
, which is not what you want.