Reversing the Agenda-View sort order?

Many thanks to the dhtmlxScheduler authors, nice work. Have a question about the Agenda view plugin.

The data I’m passing is sorted from Newest to Oldest, however the Agenda view always seems to display the data from Oldest to Newest. I can’t seem to find any configuration options to help. How can I flip the Agenda View display order, so the most recent activity is always displayed at the top?

Thanks again.



Can you please attach screenshot?
By default it should show the closest event first.

Kind regards,

No problem. Here is a snapshot of my custom agenda view (full of test entries)

To display this I simply call:

scheduler.config.agenda_start = agendaDate
scheduler.init(agendaDIV, agendaDate, ‘agenda’)

and for my agendaDate I call:

agendaDate = new Date(‘2012-01-01’)

This is the display regardless of whether my scheduler.parse receives this order, or the opposite order.

Hope this helps, let me know if I can do anything else to help.

To the team working hard at releases, thank you!

Anyone have any idea how to get the Agenda to display the most recent events at the top?

Could really use some help, hope there’s a flag or parameter I can set that I’m just not finding.

Thanks again.


It shows events closes to the specified “start” date. By default it is current date.
So the closest event would be displayed first and so on.

For now there is no way to modify that behavior without editing original source code.

[code] function fill_agenda_tab(){
//get current date
var date = scheduler._date;
//select events for which data need to be printed

	var events = scheduler.get_visible_events();
	events.sort(function(a,b){ return a.start_date>b.start_date?1:-1});[/code]

Best regards,

Very helpful, thanks Ilya!

I ended up modifying the source code, flipped that > to a < and now the agenda is displaying in the correct order.

Really appreciate your pointing me in the right direction!!! Great job!! :smiley:

Happy Holidays!!!