"isSlotAvailable" method returning "false" every time

Hi,
I am working on a project where events can be resizable and draggable. There are single level resources/groups. I wanted to check if the slot is available on "resizeStop" and "dragStop" event. In both cases I am passing 3 arguments like:

schedulerRef.current.isSlotAvailable(startTime, endTime, groupIndex);


Increasing or decreasing an event duration by resizing, above code is returning "false".


I need to get whether resized/dropped event is overlapping with another event for particular resource/group. How can I get that?

Regards,
Sk. Azadur Rahman


3 Replies 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team August 24, 2022 01:58 PM UTC

Hi Azadur,


We have validated your query at our end. We suggest you to directly pass the appointment data value to the isSlotAvailable method to check the slot availability as shown in the below code snippet.


Sample: https://stackblitz.com/edit/react-uh9a81?file=index.js


onDragStop(args) {

    if (!this.scheduleObj.isSlotAvailable(args.data)) {

      args.cancel = true;

    }

  }

onResizeStop(args) {

    if (!this.scheduleObj.isSlotAvailable(args.data)) {

      args.cancel = true;

    }

  }


Kindly try the shared sample and let us know if this meets your requirement.


API: https://ej2.syncfusion.com/react/documentation/api/schedule/#isslotavailable


Regards,

Ruksar Moosa Sait


Marked as answer

SA Sk Azadur Rahman August 25, 2022 07:16 PM UTC

Hi Ruksar,

Thanks for the solution. It solved my problem.

Regards,

Sk. Azadur Rahman



RV Ravikumar Venkatesan Syncfusion Team August 26, 2022 04:54 AM UTC

Hi Sk Azadur Rahman,


Thanks for the update.


We are happy that our solution solved your problem.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon