search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

When switching between gantt and resources view the resource-column-width is not updated

Asked by Viktor Eriksson
7 years ago.

Have a checkbox where I can switch between gantt-view and resources-view.
Event names are usually longer than resources names and when I switch back to resources-view the resources-column stays the same width as the longes event-name.

Fiddle can be found here:

Answer posted by Dan Letecky [DayPilot]
7 years ago.

The row header width auto-fit feature works like this:

1. It will extend the width beyond the initial width if needed. It starts from rowHeaderWidth - the new width is never smaller.
2. It stores the updated value back to rowHeaderWidth property.

See also:

There might become more configurable in the future but at this moment the solution is to reset the width to a small value before calling .update():

// ...
  if (dps.viewType == "Gantt"){
      dps.viewType = "Resources";
  } else {
       dps.viewType = "Gantt";   
  dps.rowHeaderWidth = 20;

See the updated jsfiddle:

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.