0

I'm creating web2py site using FullCalendar Scheduler Javascript event calendar.
I create 3 different views:

views: {
    agendaDay: {
        type: 'agenda',
        duration: { days: 1 },
        titleFormat: 'ddd D MMMM YYYY',
        slotLabelFormat: 'HH:mm',
        slotDuration: '00:15:00',
        groupByResource: true
    },
    agendaTwoDay: {
        type: 'agenda',
        duration: { days: 2 },
        titleFormat: 'ddd D MMMM YYYY',
        slotLabelFormat: 'HH:mm',
        slotDuration: '00:15:00',
        groupByResource: true
    },
    agendaWeek: {
        type: 'agenda',
        duration: { weeks: 1 },
        titleFormat: 'ddd D MMMM YYYY',
        slotLabelFormat: 'HH:mm',
        slotDuration: '00:15:00',
        groupByResource: true
    }
}

The defaultView is agendaWeek, but a user can choose. If the user choose another view and create an event, I want that after creating event the view selected by the user will be shown. Not the defaultView. How to do?

I have to work in the controller web2py function or directly in the web2py view? In which way?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

0

Above views just add this as a FullCalendar option

defaultView: default_view,

where default_view is the string value of a view name like "agendaTwoDay".

Daffy13
  • 519
  • 10
  • 21
  • Yes, I have this. It's normal. But this is not the question. The question is: when a user select a view, for example "agendaDay" and create an event, I want that this instruction "redirect(URL('sched.html',args=sede_risorsa),client_side=True)" after creating new event redirect to the page html with the same view, but it doesn't happen because in the html page sched.html defaultview is equal to "agendaTwoday" (defaultView: 'agendaTwoday',). This is the problem. I need to save the type of view chosen by the user and select this view before...but I don't know the mechanism... – Andrea Fae' May 01 '17 at 16:52
  • To me your question is much broader than fullcalendar. I would read this and decide which implementation you want http://stackoverflow.com/questions/19867599/what-is-the-difference-between-localstorage-sessionstorage-session-and-cookies/19869560#19869560 – Daffy13 May 02 '17 at 12:08