Hi David,
Thanks for your patience.
We have prepared the workaround sample to meet your requirement with load on demand concept along with the option to handle the back-end data [current date, current view and other things] which can be downloaded from the below location:
In client-side, we have raised the “create” and “actionComplete” event to get the required data from database and also to process the date conversion problem. In these events, we can also pass additional parameters to the server-side.
The following code has been used in the above sample -
<Code>
function getData(args) {
if (args.type == "create" || args.type == "actionComplete") {
var dataManger = ej.DataManager({ url: "Data.php" });
dataManger.adaptor = new ej.UrlAdaptor();
var query = new ej.Query();
//Here pass the required parameters to filter data
query.addParams("CurrentDate", new Date(new Date(this.currentDate()).setHours(0, 0, 0))).addParams("CurrentView", this.currentView()).addParams("CurrentAction", args.type);
var queryPromise = dataManger.executeQuery(query);
queryPromise.done(function (e) {
var appointments = [], data = e.result;
for (var i = 0; i < data.length; i++) {
appointments.push({ Id: parseInt(data[i]["Id"]), Subject: data[i]["Subject"], AllDay: parseInt(data[i]["AllDay"]), StartTime: new Date(data[i]["StartTime"]), EndTime: new Date(data[i]["EndTime"]), Recurrence: parseInt(data[i]["Recurrence"]), RecurrenceRule: data[i]["RecurrenceRule"] });
}
$("#Schedule1").ejSchedule({ appointmentSettings: { dataSource: appointments } });
});
}
}
<Code>
Kindly check the above sample and let us know, if you need any further assistance on this.
Regards,
Mahesh