Added horizontal grid scroll and task click no longer takes me to the start of the task in timeline


#1

I’ve added the following options to toggle between the grid and grid+chart and now when I click on a task in the grid it doesn’t take me to the start of the task in the timeline. Is this by design - is there a way I can enable this with a complex layout without having to reimplement it with getTaskPosition and scrollTo?

const only_grid = {
    css: "gantt_container",
    cols: [
        {
            rows: [
                { view: "grid", scrollX: "gridScroll", scrollable: true, scrollY: "scrollVer" },
                { view: "scrollbar", id: "gridScroll", scroll: 'x', group: 'hor' },
            ]
        },
        { view: "scrollbar", id: "scrollVer" }
    ]
};

const grid_and_chart = {
    css: "gantt_container",
    cols: [
        {
            rows: [
                { view: "grid", scrollable: true, scrollX: "gridScroll", scrollY: "scrollVer" },
                { view: "scrollbar", id: "gridScroll", scroll: 'x', group: 'hor' },
            ]
        },
        { resizer: true, width: 1 },
        {
            rows: [
                { view: "timeline", scrollX: "timelineScroll", scrollY: "scrollVer" },
                { view: "scrollbar", id: "timelineScroll", scroll: 'x', group: 'hor' },
            ]
        },
        {
            view: "scrollbar",
            id: "scrollVer"
        }
    ]
}

See below an example of a clicked task no longer scrolling to the task in the timeline.


#2

Hello Skoofy,
This is because the scrollbar for the timeline doesn’t have the required name. Gantt continues working with custom scrollbar names, but the code for scrolling(and some other features) expects the predefined scrollbar names:
https://docs.dhtmlx.com/gantt/desktop__layout_config.html#requiredviewsandsettings
If you use the default scrollbar name, it will work correctly:
https://snippet.dhtmlx.com/5/ecdb905f9

The dev team will add the feature to support custom scrollbar names for all features, but I cannot give you any ETA.


#3

Brilliant, ramil! You’re a deadset legend for getting back to me with these answers. Thanks!