Categories | Question details Back To List | ||
DHTMLScheduler - remember the view Can you give an example of how I might make it so that the scheduler would remember the date-range and view (week-month-day) that the user was last on if they browse away and back I am using PHP and want to use session or cookies I guess, cookies would be best I think. I think I have the view working but it always show a view centered around today and not whatever date they were on when they left. thanks Answer posted by Support on Sep 07, 2009 03:39 Current version has not ready to use extension for such use-case. You can use events of scheduler to save the state to cookie. >> var myDate=new Date(sugar_calendar_date) Answer posted by Ken Brill on Sep 07, 2009 09:44 I found that the code below seems to work, I have to add default code for when the cookie doesn't exist still but that should be easy. I was just making it harder than it actually was. var sugar_calendar_date = Get_Cookie('sugar_calendar_date'); var sugar_calendar_view = Get_Cookie('sugar_calendar_view'); var myDate=new Date(sugar_calendar_date) scheduler.init('scheduler_here',myDate,sugar_calendar_view); and scheduler.attachEvent("onViewChange", function (mode , date){ Set_Cookie('sugar_calendar_view',mode,30,'/','',''); Set_Cookie('sugar_calendar_date',date,30,'/','',''); }); I am currently working up the proof of concept to use this tool and buy a license and I must say that this is the best support I have ever gotten from anywhere. Every answer is honest and examples are given when needed. Great tool and great support, keep up the good work. |