onScaleClick

fires when the user clicks on the cell in the time scale

void onScaleClick(Date date);
dateDatethe date of the clicked cell

Example

gantt.attachEvent("onScaleClick", function (e, date) {
    //your custom code
});

Details
let selected_column = null;
 
gantt.attachEvent("onScaleClick", function (e, date) {
    selected_column = date;
    const pos = gantt.getScrollState();
    gantt.render();
    gantt.scrollTo(pos.x, pos.y);
});
 
function is_selected_column (column_date){
    if(selected_column && column_date.valueOf() == selected_column.valueOf()){
        return true;
    }
    return false;
}
Back to top