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

BeforeCellRender is only working on the top row

Asked by Ian Sheffield
2 years ago.

I'm tryhing to split, as in the screenshot attached, the scheduler into sections for a client. I have done the following in the BeforeCellRender subroutine (using VB)

If e.IsBusiness Then
If tmStart < tmBreak1 Then
e.BackgroundColor = "#FEFC8D"
ElseIf tmStart >= tmBreak1 And tmStart < tmBreak2 Then
e.BackgroundColor = "#ACFFA5"
Else
e.BackgroundColor = "#A5E0FF"
End If
Else
e.BackgroundColor = "#D5CFB3"
End If

but as you can see, it's only affecting the top row. What's going on?

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

DayPilot optimizes the cell data - if it detects that all cells in a column use the same properties it is compressed.

It looks like the mechanism has failed for some reason.

Can you please check the output HTML of the page and look for a line that starts with "v.cellConfig = ...". It will look like this:

v.cellConfig = {"default":{"business":1},"y":15,"vertical":true,"horizontal":false,"x":732};

Can you please post that line here?

Comment posted by Ian Sheffield
2 years ago.

v.cellProperties = {"0_0":{"backColor":"#FEFC8D","business":1},"1_0":{"backColor":"#FEFC8D","business":1},"2_0":{"backColor":"#FEFC8D","business":1},"3_0":{"backColor":"#FEFC8D","business":1},"4_0":{"backColor":"#FEFC8D","business":1},"5_0":{"backColor":"#FEFC8D","business":1},"6_0":{"backColor":"#FEFC8D","business":1},"7_0":{"backColor":"#FEFC8D","business":1},"8_0":{"backColor":"#FEFC8D","business":1},"9_0":{"backColor":"#FEFC8D","business":1},"10_0":{"backColor":"#ACFFA5","business":1},"11_0":{"backColor":"#ACFFA5","business":1},"12_0":{"backColor":"#ACFFA5","business":1},"13_0":{"backColor":"#ACFFA5","business":1},"14_0":{"backColor":"#ACFFA5","business":1},"15_0":{"backColor":"#ACFFA5","business":1},"16_0":{"backColor":"#ACFFA5","business":1},"17_0":{"backColor":"#ACFFA5","business":1},"18_0":{"backColor":"#ACFFA5","business":1},"19_0":{"backColor":"#ACFFA5","business":1}};
v.cellConfig = {"vertical":true,"horizontal":false,"x":32,"default":{"backColor":"#A5E0FF","business":1},"y":29};

I have checked the CSS and it does hold colours for business and non-business, but these should be overwritten by the BeforeCellRender, yes? I've commented them out in the screenshot earlier, so the background CSS is not running at that point.

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

That seems to be fine. Just to make sure - what version of DayPilot do you use?

Comment posted by Ian Sheffield
2 years ago.

Thanks. The dll date is 07/09/2015 wo I think that's 8.1 SP2. I am updating now to 8.2

Answer posted by Ian Sheffield
2 years ago.

8.2 has fixed it. Thanks very much.

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

Great, thanks for the update.

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