Premium support for our pure JavaScript UI components


Post by clovisapp »

Hi Bryntum team,

Inside Bryntum calendar in "agenda" mode, when going in the "past" week or days with the arrows, is there a way to detect that it's in the past, and to list events in a reverse order ? = sorting the events in descending order ?
By default the events are sorted by date in ascending order, but when going in the past, it can create some UX confusing, the best is to have them in descending order.

Thanks a lot for your help !

Attachments
Screenshot 2024-02-09 at 15.36.09.png
Screenshot 2024-02-09 at 15.36.09.png (367.07 KiB) Viewed 180 times

Post by Animal »


Post by Animal »

In a sorter, you don't see the date of the particular cell for which you are sorting the events. We should fix that.

In the meantime, you can use the dayCellpopulated event to sort the events in a cell:

        agenda : {
            listeners : {
                dayCellPopulated({ date, events }) {
                    // Sort "events" using your sort logic
                }
            }
        }

Post by clovisapp »

Thanks a lot @Animal, can you write the full code example with "dayCellPopulated" ?

How does it work, with a "return" ?


Post by Animal »

Just mutate the events array.


Post by clovisapp »

@Animal, please can you give full examples at some point ?

there's many way to mute an array


Post by Animal »

Well you want to sort it don’t you?

events.sort(yourSortFn)


Post Reply