Custom elements being hidden on task type change.

Hi there,

I have my light box sections setup like this.

    gantt.form_blocks['color_select'] =
      render: (sns) ->
        "<div class='gantt-color-picker-container'></div>"
      set_value: (node, value, task, section) ->
        # node.childNodes[1].value = value or ''
        # node.childNodes[4].value = task.users or ''
      get_value: (node, task, section) ->
        # task.users = node.childNodes[4].value
        # node.childNodes[1].value
      focus: (node) ->
        # a = node.childNodes[1]
        # a.focus()

    gantt.config.lightbox.sections = [
      { name: "description", height: 70, map_to: "text", type: "textarea", focus: true },
      { name: "type", type: "typeselect", map_to: "type" },
      { name: "color", map_to: "text", type:"color_select" },
      { name: "time", type: "duration", map_to: "auto" }

Then on initialization, I have some code setup, to initialization my color selector. This works great, when my typeselect is a “Task”.

However, upon changing it to “Project” or “Milestone”, the color part of my lightbox section disappears. When I change it back to “Task”, it appears again. How do I ensure, it stays for all types?

Basically, the render function never gets called on “Project” or “Milestone” type.

Thanks in Advance!


Each type of a task may have its own set of characteristics - because of this, an individual configuration of the lightbox can be defined for each type. All configurations are stored in the lightbox object.

Please find more info here: … oreachtype

Thank you, that worked.