Second Agenda View for Past Events + Userid Filter

Hi there,

I was wondering if there was a way to add a custom view to my scheduler that displays past events. This would exactly look like the agenda view, just starting with the last completed event, going further back in time as one scrolls down.

Also I have a field in my database called ‘userid’. Is it possible to filter the events when retrieved from the database? The idea is that user 1 sees only his own events, etc.

Thanks for the help - really in love with scheduler!

scheduler.attachEvent(“onEventLoading”, function(ev){
if (ev.user_id != CURRENT_USER_ID) return false;
return true;
});

A bit problematic, you can configure agenda to show different time ( future, or past events ) but you can’t have two agendas in same time.
As possible workaround you can use the same agenda view, and by pressing some button change range of visible dates ( scheduler.config.agenda_start, scheduler.config.agenda_end )

Great, the user_id thing works like a charm.

For my past events view:

I have managed to display a button:

click

My only problem is now, that it also has to switch to the Agenda tab after making the changes. How does that work?

My ultimate goal is to attach this code to a custom tab. How would I do that? Code it into the

via onclick or is there a nicer way to do this?

Also, this needs to work the other way as well: When the user clicks on the actual agenda tab, it should display only the future events.

Thank you so much for your help!!