Change appointment color on resize and drop

Hi,

Is it possible to change the color of an appointment when resizing or dragging an appointment? 

I tried the resizeStop event and then change the element in the event but doesnt work :-(


Thanks in advance,


Peter


1 Reply

RM Ruksar Moosa Sait Syncfusion Team January 24, 2022 01:54 PM UTC

Hi Peter,


You can change the color of the appointment on dragging or resizing by binding the id of the data in eventRendered method like the below code snippet.


eventRendered: (args) => {
if (id != null && id === args.data.Id) {
args.element.style.backgroundColor = "orange";
id = null;
}
},
//To change appointment color through dragging
dragStop: (args) => {
id = args.data.Id;
},
//To change appointment color through resizing
resizeStop: (args) => {
id = args.data.Id;
},


Sample: https://codesandbox.io/s/vue-appointment-color-change-on-drag-resize-forked-csebg?file=/src/App.vue


Kindly try the above sample and let us know it this meets your requirement.


Regards,

Ruksar Moosa Sait


Loader.
Up arrow icon