scrolljavafxjfxtras

How to scroll to a selectedAppointment in JFXtras Agenda


I have some kind of 'find' function, where I select an appointment by adding it to the selectedAppointments list. Works, but Agenda does not scroll to the correct position automatically. So in some cases, the user cannot see the selected appointment.

How can I tell Agenda to scroll to the correct position?

Thank you!


Solution

  • There is a displayedLocalDateTime property on Agenda (or displayedCalendar if you are still using the depricated property). It will tell Agenda to show that specific moment in time, but depending on the active skin (week, day, or whatever the future will bring) that may be a different time frame.

    After rereading, I noticed that you used the word "scroll" very specifically, so I checked and agenda correct shows the date based on displayedLocalDateTime, but it did not scroll to the correct time within that date. Fixed that just now.