Premium support for our pure JavaScript UI components


Post by mkelch »

Hello team,

I am working with Scheduler Pro and ran into an inconsistency when overriding the overlappingEventSorter function.

In the demo code linked below (which should work when pasted into one of your demo examples), I've implemented a custom overlappingEventSorter callback that should prioritize events with type == 'holiday' before events with type == 'non-holiday'.

However, you can see in the attached screenshot that the left-most and bottom-most events render correctly, but the middle two overlapping events are swapped. The blue 'non-holiday' event should be sorted below the red 'holiday' event.

Is this a defect with the library? Or is prioritizing non-startDate fields not supported?

Thanks!

Attachments
Test_OverlappingEventSorter.js
(2.64 KiB) Downloaded 19 times
Incorrect_Overlap.png
Incorrect_Overlap.png (25.7 KiB) Viewed 149 times

Post by fabio.mazza »

Hello,
as the guide explains:

NOTE: The algorithms (stack, pack) that lay the events out expects them to be served in chronological order, be sure to first sort by startDate to get predictable results.

then, event with id 3, that has an earlier startDate respect than event 2, is positioned above event 2, although it has 'non holiday' type

Best regards,
Fabio


Post Reply