displays an additional layer with custom elements for a link in the timeline area

string addLinkLayer(function|object func);


funcfunction|objecta render function or a config object


stringa DOM element that will be displayed in the layer

Available only in PRO Edition


gantt.addLinkLayer(function (link) {
  var node = gantt.getLinkNode(
  if (node) {
    var el = document.createElement('div');
    el.className = 'link_layer'; = node.childNodes[2].offsetLeft + 'px' = 25 + 'px' = node.childNodes[2].offsetTop + 'px' = 25 + 'px'
    return el;
  return false;


This functionality is available in the PRO edition only.

  • The argument function takes a link's object as a parameter and must return a DOM element that will be displayed in the layer.
  • The argument can also be an object. In this case, it can have the following properties:
    • render - (function) a function that answers for rendering the layer's elements (mandatory)
    • container - (HTMLElement) a layer's container (optional)
    • topmost - (boolean) if true, the element will be displayed over the link (optional)
    • filter - (function) a function that takes a link object as a parameter. If returns 'false', the 'render' function won't be called for a link (optional)
  • Beware, custom layers will be reset after the next call of gantt.init
  • Calling the gantt.resetLayout() method will also reset custom layers. In order for custom layers to be displayed on a page, you need to redefine the gantt.addLinkLayer method after calling resetLayout.

Related sample:  addLinkLayer

See also
Back to top