Is there a way to reload data on month or day change? Right now i am only loading current month data, if user navigates to next/prev month i want to reload data for selected month.
Here is not such aready functionality. However, you may try to implement it.
$$(“scheduler”).coreData is an object that contains an actual date of the scheduler. When you click navigation buttons in Day and Month view, the valueof this object (scheduler date) is changed, onChange will be fired:
$$(“scheduler”).coreData.attachEvent(“onChange”,function(date){
var activeView = $$(“scheduler”).$$(“buttons”).getValue();
/your code/
});
You may try to call loading for new events. For the month view, you will need to load events with date from date that is got from onChange event to this date + one month. To get this date you may use dhx.Date.add method:
var endDate = dhx.Date.add(startDate,1,“month”);
Thanks for the reply.
I was able to reload data using below:
var mdate;
$$(“scheduler”).attachEvent(“onItemClick”, function (id) {
var mcurrdate = $$(“scheduler”).coreData.getValue();
if (mcurrdate.getMonth() != mdate.getMonth()) {
mdate = mcurrdate;
loaddata(mdate);
}
});
$$(“scheduler”).$$(“calendar”).attachEvent(“onAfterMonthChange”, function (newDate, oldDate) {
try {
mdate = newDate;
loaddata(mdate);
} catch (e) {
alert(e.message);
}
});
Hi,
This is exactly what I need to do too, but I can’t figure out how to use this code.
Can you lend a poor mortal a hand with a larger code sample?
Oh, this is for touch… nevermind then.