We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

isSlotAvailable returns false from within scheduleObject.saveEvent()

Thread ID:

Created:

Updated:

Platform:

Replies:

143412 Mar 19,2019 02:47 PM UTC Mar 20,2019 12:37 PM UTC ASP.NET Core - EJ 2 3
loading
Tags: Scheduler
Stefan
Asked On March 19, 2019 02:47 PM UTC

Hi,
when I check if the slot is available in onActionBegin for an existing event from the editor, isSlotAvailable() returns true.
If I programmatically change the event and call saveEvent(data), the same function with the same parameters returns false in onActionBegin:

console.log(data.StartTime, typeof(data.StartTime), data.EndTime, groupIndex, typeof(groupIndex),
                getScheduleObject().isSlotAvailable(data.StartTime, data.EndTime, groupIndex));

Through the Editor:
Wed Mar 20 2019 08:00:00 GMT+0000 (Greenwich Mean Time), Wed Mar 20 2019 10:00:00 GMT+0000 (Greenwich Mean Time), 1, true
Through saveEvent()
Wed Mar 20 2019 08:00:00 GMT+0000 (Greenwich Mean Time), Wed Mar 20 2019 10:00:00 GMT+0000 (Greenwich Mean Time), 1, false

e.g.
getScheduleObject().getEvents()[0].Subject = "Some Changed Subject here" // << (Event exists!)
getScheduleObject().saveEvent(getScheduleObject().getEvents()[0])

Editing the same event through the editor (making the same change, e.g .to the Subject), works fine.

Could you please point me towards my error?
Thanks!

Stefan
Replied On March 19, 2019 03:14 PM UTC

It's the same whether accessing ..getEvents[index] or ..eventsData[index].

What is funny is that the Guid appears to change on the event. From Editor:
EndTime: Wed Mar 20 2019 10:00:00 GMT+0000 (Greenwich Mean Time) {}
EndTimezone: null
Guid: "19cc52ba-7c1a-b5d4-7b55-00aadafaa366"
Id: 2094
IsBlockAppointment: false
IsReadOnly: false

From saveEvent()
EndTime: Wed Mar 20 2019 10:00:00 GMT+0000 (Greenwich Mean Time) {}
Guid: "ba6faeb8-a22b-9fad-796e-8a96ca7bb37a"
Id: 2094
IsBlockAppointment: false
IsReadOnly: false

Guid is different, Start and EndTimeZone is null from Editor, but not there at all from saveChanges().  RecurrenceRule: null from saveChanges(), but undefined from Editor. This is slightly weird...

Stefan
Replied On March 20, 2019 11:48 AM UTC

After looking through the code, I could see that isSlotAvailable compares the guid to Schedule.activeEventData.event.

So in theory this should work until the bug is fixed:
let eventToModify = getScheduleObject().getEvents()[0];
eventToModify.Subject = "Some Changed Subject here"
getScheduleObject().activeEventData.event = eventToModify;
getScheduleObject().saveEvent(eventToModify);

Will I have to combat any side effects if I go down this path? Can I leave the "element" as undefined, or as whatever it is at that time?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 20, 2019 12:37 PM UTC

Hi Stefan,


Thank you for contacting Syncfusion support.

We could reproduce the reported issue and logged the below bug report. Fix will be included in JS2 weekly release on or before April 9, 2019.


Regards,
Karthi

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;