onScaleClick

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

void onScaleClick(Date date){ ... };

Parameters

dateDatethe date of the clicked cell

Example

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

Details
var selected_column = null;
 
gantt.attachEvent("onScaleClick", function (e, date) {
    selected_column = date;
    var 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