Hi
someone can explain to me why manually added events to a Calendar component (using a ListCalendarEventProvider) are displayed in the correct order when in weekly view but reversed when in monthly view?
I’ve attached a couple of screenshots with a calendar filled with auto-generated events (in a simple loop), that shows the difference between weekly (correct) and monthly view (reversed).
Hi Gleb, thanks for responding.
Events are all of fixed length (15 minutes), they can’t overlap, and they can’t be resized.
In addition, events are always added to the provider in order (by start time), and they can’t be reordered afterward.
So for example, I can have the sequence 9:00-9:15 , 9:15-9:30 and so on for a day, with or without holes between time intervals.
I have noticed that the HTML produced by the vaadin calendar is indeed reversed. That is, the actual HTML renders the LAST event as the first DIV inner node.
But when in weekly view, it puts computed “top” style properties to adjust the order (in an absolute container), so that the last DIV element appears at the top and so on…
Instead, when in monthly view, this adjustment is not made (no “top” style properties and no absolute placement), so the browser renders the DIVs in their actual order, that is reversed…
This is really awkward, and this sums up to the lack of advanced customization of vaadin calendar, and the fact it’s been deprecated in 8.0 without a replacement…
Hope to find a quick workaround without the need of rewriting part of the component itself (already done that for another component, and it’s not funny).
Attached a very simple project, with only one screen.
There I create some synthetic events and add them to a calendar control, using the start/end date range specified by the two fields at the top.
You’ll notice what I wrote above… quoting myself: I have noticed that the HTML produced by the vaadin calendar is indeed reversed. That is, the actual HTML renders the LAST event as the first DIV inner node.
But when in weekly view, it puts computed “top” style properties to adjust the order (in an absolute container), so that the last DIV element appears at the top and so on…
Instead, when in monthly view, this adjustment is not made (no “top” style properties and no absolute placement), so the browser renders the DIVs in their actual order, that is reversed…
This happens to be a quirk of the vaadin calendar… wish you embedded something like JQuery calendar or, better, some other vanilla js alternative.