Load JSON data on button clicks and redraw scheduler

How would I load data for each of the buttons today, prev and next?

I’m currently using scheduler.load to load the current days JSON data. When I click next, prev or today I would like the data to load and the timeline to redraw.

 scheduler.load(<cfoutput> 'jsonProxy.cfm?currdate='+ currdate,"json");

Do I need to write click events for each button or is there an easier way?

//get next date
//do another scheduler.load and pass in new date

//do ajax get to load new sections
//I want to redraw sections and not update them because I don’t want to add to them


you can use this event
docs.dhtmlx.com/scheduler/api__s … event.html
It is triggered each time the displayed view or date changes (i.e. when next/prev/today buttons clicked). In handler you can check if the displayed date has changed and load data if it’s needed

scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){ if(date.valueOf() != old_date.valueOf()){ scheduler.load('jsonProxy.cfm?currdate=' + scheduler.templates.xml_format(date),"json"); } return true; });

Alternatively, you can use the built in option for a dynamic loading, which will do the same
docs.dhtmlx.com/scheduler/loadin … micloading