Hi,
I am trying to go from the month (or week) view to the map view with one click: when I click on an event in the month view, I want to be redirected to the map (and show the location of the corresponding event).
How can I achieve this ?
Thanks !
Hello,
you can use this event
docs.dhtmlx.com/scheduler/api__s … event.html
Use scheduler.getState() in order to determine whether it’s called from a month view, and scheduler.setCurrentView() to switch to the map
docs.dhtmlx.com/scheduler/api__s … state.html
docs.dhtmlx.com/scheduler/api__s … tview.html
Thanks a lot Aliaksandr!
It works pretty well. I defined this function :
scheduler.attachEvent(“onClick”, function (id, e){
var eventObj = scheduler.getEvent(id);
scheduler.setCurrentView(new Date(eventObj.start_date), “map”);
return true;
});
I have a small issue now though. When I click on the event, it sends me to the map view. Then when I click on another view (month or week), it displays both views : map and month for instance…
Kinda weird. Any ideas what is going on ?
Thanks !
Hello,
that is unusual. Can you reproduce the issue using our snippets?
docs.dhtmlx.com/scheduler/snippet/