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

Cannot read property 'height' of undefined

Asked by João Louro
7 years ago.

I'm developing a js calendar for a website at our comapny(I'm using trial pro version)

One of the requirements is that the scale can be changed with one click, this is done.

dp.onBeforeTimeHeaderRender = function(args) {
var startDate = args.header.start.getDatePart().value;
var endDate = args.header.end.getDatePart().value;
var overlapDate = false;

overlapDate = DayPilot.Util.overlaps(new DayPilot.Date("2017-01-01"), new DayPilot.Date("2017-01-07"), startDate, endDate);

if(overlapDate){
args.header.backColor = "#ff0000";
}
};
dp.update();
dp.show();

On certain dates I want to color the header, I can do this without much of a problem using the code above.

When I switch the scale from week(default) to day the following error shows up:

Cannot read property 'height' of undefined

What does this means? How can I fix this Issue?

Also, I'm integrating DayPilot api on an OutSystems website, when the scale change is done a ajax refresh is performed.

Best Regards,
João Louro

Answer posted by João Louro
7 years ago.

After trying a few things I've came to the conclusion that dp.update() can not be executed before dp.show() or vice-versa.

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