I have functionality that finds the next available time, which can mean the scheduler I have goes to the next week (changes view) or the week after, depending on when the next time slot is available. I then update the start time input in my event editor to reflect the next available time (end time input updates automatically according to start time), then call the scheduler.select() method passing the start and end time so that the user can visibly see the time slot to be filled if they choose that, as it will be highlighted blue.
This works fine as long as the scheduler does not have to move to the next week. When it does... navigate is called, which causes a change event, which automatically selects the first time slot of the new view (the all day event for Sunday, the very first slot in the scheduler view). This overrides my manual selection. My times are correct for my event in the editor, I just need to visualize it for the user.
Is there a way to prevent navigating to a new view from changing my current selection on the scheduler?
You can first navigate to the date yourself and then select the time slots:
var scheduler = $("#scheduler").data("kendoScheduler");
let startDate = new Date("2017/6/15 8:00");
let endDate = new Date("2017/6/15 11:00");
scheduler.date(startDate);
scheduler.select({
start: startDate,
end: endDate
});
Since you know the date of he selection, you can you it as is for setting the date of the scheduler.