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

Uncaught RangeError: Maximum call stack size exceeded for versions after 4481

Asked by Wouter van den Beld
3 months ago.

DayPilot Pro for JavaScript 2020.2.4481 works ok.

all updates after DayPilot Pro for JavaScript 2020.2.4516 will cause the error: Uncaught RangeError: Maximum call stack size exceeded.

Answer posted by Dan Letecky [DayPilot]
3 months ago.

This indicates an infinite loop and it might be caused by an event handler or another method calling itself recursively. You might be able to find the problem by checking the stack trace. Please let me know if you believe it's caused by DayPilot itself.

Comment posted by Wouter van den Beld
3 months ago.

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();

Comment posted by Dan Letecky [DayPilot]
3 months ago.

Thanks for the update!

The infinite scrolling won't work with any values - you need to follow certain rules that are listed here:
https://doc.daypilot.org/scheduler/infinite-scrolling/

In the future, the Scheduler might check if these rules are followed but at this moment they are not enforced.

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