why my LoadData action call twice when i change the scheduler day view to week or day to month view.
if i change date or resource of scheduler then also loaddata call twice
when my onchagneresource function call then loaddata call twice
function onchagneresource()
{
$.ajax({
type: "POST",
data: param,
url: '@Url.Action("GetResourcesByLoc", "Home")',
async:false,
success: function (data) {
datapro = data.schproviders;
debugger
let scheduleObj1 = document.querySelector('#mainSchedule').ej2_instances[0];
scheduleObj1.resources[1].dataSource = datapro;
scheduleObj1.dataBound;
}
});}
public JsonResult LoadData(Params param) // Here we get the Start and End Date and based on that can filter the data and return to Scheduler
{
string loc = param.Location;
string res = param.ResourceId;
DateTime start = param.StartDate;
DateTime end = param.EndDate;
var data = new SchedulerData().GetAppointments(start, end, loc, res);
var jsonResult = Json(data, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
}