RadiantQ Forum
Product => jQuery Gantt Package => Topic started by: magnus.sundstrom 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?
-
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.
-
Here you go: http://i59.tinypic.com/160yhw4.png (http://i59.tinypic.com/160yhw4.png)
-
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:
$gantt_container.GanttControl({
....
GanttChartTemplateApplied: function (sender) {
var $GanttChart = $gantt_container.data("GanttControl").GetGanttChart();
$GanttChart.GanttChart({ AnchorTime: anchorTime, ViewWidth: 3000 });
}
});
Regards,
-Raja.
-
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:
$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...
-
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.
-
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!
-
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.