When i enable dp.infiniteScrollingEnabled = true; the error occurs.
i forgot to add dp.days before dp.init.
can you explain when i add dp.days = 60 i get no error and it works and when i use dp.days = 30 i get the Uncaught RangeError: Maximum call stack size error.
I use the following to set the initial days.
function SetMonth() {
applyLevel(0, new DayPilot.Date());
}
function SetWeek() {
applyLevel(1, new DayPilot.Date());
}
function SetDay() {
applyLevel(2, new DayPilot.Date());
}
var levels = [
{
name: "Maand",
scale: "Day",
navigatorMode: "month",
cellDuration: 720,
cellWidth: 40,
timeHeaders: [{groupBy: "Month"}, {groupBy: "Day", format: "ddd d"}],
start: function(d) { return d.firstDayOfMonth(); },
days: function() { return dp.startDate.daysInMonth();},
},
{
name: "Week",
scale: "Hour",
navigatorMode: "week",
cellWidth: 40,
timeHeaders: [{groupBy: "Month"}, {groupBy: "Day", format: "dddd d"}, {groupBy: "Hour"}],
start: function(d) { return d.firstDayOfWeek(); },
days: function() { return 7; },
},
{
name: "Uur",
scale: "CellDuration",
navigatorMode: "day",
cellDuration: 15,
cellWidth: 40,
timeHeaders: [{groupBy: "Day", format: "dddd MMMM d, yyyy"}, {groupBy: "Hour"}, {groupBy: "Cell"}],
start: function(d) { return d.getDatePart(); },
days: function() { return 1; },
},
];
function init() {
applyLevel(0, new DayPilot.Date());
}
function applyLevel(index, date) {
var level = levels[index];
if (!date) {
date = dp.getViewPort().start.addTime((dp.getViewPort().end.getTime() - dp.getViewPort().start.getTime())/2);
}
dp.startDate = level.start(date);
dp.scale = level.scale;
dp.days = level.days() * 3;
dp.infiniteScrollingStepDays = level.days()
dp.timeHeaders = level.timeHeaders;
dp.cellDuration = level.cellDuration;
dp.cellWidth = level.cellWidth;
dp.update();
dp.scrollTo(dp.startDate, null, "middle");
nav.selectMode = level.navigatorMode;
nav.update();
}
init();