How to change the DragItem or ResizeItem style props dynamically

1 Answer 121 Views
Scheduler
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 13 Oct 2022, 11:25 AM

Hi Team, 

As my title says, Im trying to change style props of a drag/resize item, specifically the background color. My use case is that when an event is dragged or resized into an invalid time slot, I want the drag/resize item to become red.

After messing around with the SchedulerItem and SchedulerEditItem, the best I can do is to change both the SchedulerItem and DragItem colors if the slot is invalid, see my CustomItem, but I only want the dragItem to change. I tried setting the style on the dragItem in both the ScheduleItem and ScheduleEditItem with no success.

I see in the docs there is a SchedulerDrag component, but I cannot find how/where its used.

Side Note: If I log the output of `useSchedulerEditItemDragItemContext()` it logs an array with 3 elements, [dragItem, setDragItem, ???]  what the second function, because I cannot it an any docs

Thanks,
Grant

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 15 Oct 2022, 03:56 PM

Hi Grant,

Thank you for contacting us.

The SchedulerEditItem has "drag" property, which allows the customization of the SchedulerDrag item only. In the following section of the documentation you can see the nesting of the Scheduler items:

And here is the "drag" property:

With the above in mind, I have added custom item for the drag, which allows explicit customization:

Note that the same is available for the resize item through the "resize" property of the SchedulerEditItem.

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Grant
Top achievements
Rank 3
Iron
Iron
Veteran
commented on 17 Oct 2022, 07:11 AM

Thanks @Konstantin, I'll review all the docs again, I've just recently started using the scheduler widget and its quite comprehensive :)
Tags
Scheduler
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Konstantin Dikov
Telerik team
Share this question
or