fires when the user clicks on an empty space in the Gantt chart (not on tasks)

void onEmptyClick(Event e);
eEventa native event object


gantt.attachEvent("onEmptyClick", function (e){
    //any custom logic here


The onEmptyClick event also fires when the user clicks on a link. You can prevent this feature of the event. To do this, you need to check whether the element or the closest one to it contains the link_attribute property, as in:

gantt.attachEvent("onEmptyClick", function (e) {
  var domHelpers = gantt.utils.dom;
  if(!domHelpers.closest(, "[" + gantt.config.link_attribute + "]")){
    gantt.message("not a link");
Back to top