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

AreaCollection in Calendar

Asked by Petr
6 years ago.

Hello,

I would like to use new feature mentioned in release notes of version "DayPilot Pro for ASP.NET MVC 8.4" - Active areas supported in Calendar/OnBeforeCellRender

Unfortunately I am not able to create any visible areas in calendar cell. I am using the same feautre in scheduler component without any problems.

My approach is simple:

protected override void OnBeforeCellRender(BeforeCellRenderArgs e)
{
var currentLocalTime = appContext.CurrentLocalTime;
if (e.Start < currentLocalTime)
{
var area = new Area();
area.Start(e.Start);
area.End(currentLocalTime);
area.CssClass("some_class_with_red_background");
area.Left(0);
area.Right(0);
area.Visible();
e.Areas.Add(area);
}
}

But no areas are visible after calendar is rendered. Am I doing something wrong? Can you please confirm that it is working?

Thanks for your reply!

Answer posted by Dan Letecky [DayPilot]
6 years ago.

The active areas are supported in Calendar cells but only with fixed positioning using area.Left/Right/Top/Bottom.

Positioning using area.Start and area.End is not supported at this moment.

Comment posted by Petr
6 years ago.

Thank you for your quick reply!

Unfortunately, I can not make it work. I have tried various combinations of positioning using Left/Right/Top/Bottom but still have no luck. No divs for areas are created in DOM.

Any suggestions from you are welcome.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

It turned out there was a bug - it should be fixed now in the latest sandbox build (8.4.5902):

https://mvc.daypilot.org/sandbox/

Let me know if the problem persists.

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