October 23, 2020, 08:06:20 AM

See more Support incidents in our old archived forum.

Author Topic: Max width?  (Read 4785 times)

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
Max width?
« on: November 13, 2014, 11:27:25 AM »
A client of ours have a Mac with a large screen with a resolution of 2560x1440 and on this screen the gantt is cut off to the right, as if there is a maximum width (it's cut at a width of 2297px). We don't have such a large screen to reproduce this issue ourselves. We're using jQuery Gantt version 4.0.22. Any ideas?

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: Max width?
« Reply #1 on: November 13, 2014, 04:15:25 PM »
Magnus,

Can you please ask your client to provide a screenshot? We would like to see where exactly this is getting cut off - the outer container or inside the gantt chart, etc.

Regards,
-Raja.

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
Re: Max width?
« Reply #2 on: November 14, 2014, 08:59:26 AM »

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: Max width?
« Reply #3 on: November 14, 2014, 02:51:53 PM »
Magnus,

This happens because our "GanttChart" portion is given by default a width of 2000 which usually is good enough for most scenarios, but in scenarios like this where the gantt container takes a much larger width, issue that you see happens. So, the quick fix is to give the gantt chart a larger width like 3000. You can do so while initializing the gantt like this:

Code: [Select]
$gantt_container.GanttControl({
    ....
    GanttChartTemplateApplied: function (sender) {
        var $GanttChart = $gantt_container.data("GanttControl").GetGanttChart();
        $GanttChart.GanttChart({ AnchorTime: anchorTime, ViewWidth: 3000 });
    }
});


Regards,
-Raja.

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
Re: Max width?
« Reply #4 on: November 17, 2014, 11:10:10 AM »
Setting ViewWidth that way had no effect. We had to set it like $GanttChart.GanttChart('option', 'ViewWidth',3000);

Problem now is that ViewWidth is reset to 2000 by our "Bring all tasks into view" code:
Code: [Select]
$gantt_container.GanttControl({
BaseTimeUnitWidthMinimum: 0.1
});
var ganttChart = $GanttChart.data("GanttChart");

$GanttChart.GanttChart({ ResizeToFit: true });
var sdate = ganttControl.Model.Activities.StartTime.clone().addDays(-7);
var edate = ganttControl.Model.Activities.EndTime.clone().addDays(7);
ganttChart.SetStartTime(sdate);
ganttChart.TrySetEndTime(edate);

$GanttChart.GanttChart({ ResizeToFit: false });

var diff = new RQTimeSpan(ganttChart.options.AnchorTime - ganttChart.VisualStartTime.Date());
var adjustedTime = ganttChart.options.AnchorTime.clone().addTimeSpan(diff);
ganttChart.BringTimeIntoView(adjustedTime);

$("#filter_startdate").val(sdate.toString("yyyy-MM-dd"));
$("#filter_enddate").val(edate.toString("yyyy-MM-dd"));
If we set ViewWidth to 3000 at the bottom of that code, the tasks are no longer in view...

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: Max width?
« Reply #5 on: November 17, 2014, 05:03:11 PM »
Magnus,

We have sent the latest source to you that fixes the reported issues.

1) Now, you can set the ViewWidth while initializing the Gantt as i mentioned in the previous response.

2) It will change back into given ViewWidth while turning off the ResizeToFit.

Could you please make sure it?


Regards,
-Raja.
« Last Edit: November 17, 2014, 05:05:08 PM by Rajagopal »

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
Re: Max width?
« Reply #6 on: November 18, 2014, 02:13:12 PM »
You sent an evaluation version..? And ViewWidth still can't be set like you wrote. The ViewWidth is reset correctly on turning off ResizeToFit, so that's good!

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: Max width?
« Reply #7 on: November 20, 2014, 02:35:34 PM »
Magnus,

We have sent the licensed version to you.

1) Could you try to reproduce this issue in the reference sample and share the code with us?



Regards,
-Raja.