Is there a way in the custom event renderer to receive props from the event about if it is selected, is dragged, resized etc?
Support Forum
Hi,
if it selected
there is scheduler.selectedRecords
property to check that.
https://bryntum.com/products/schedulerpro/docs/api/Grid/view/mixin/GridSelection#property-selectedRecords
is dragged, resized etc?
Not sure about these 2. You can check scheduler.project.changes
or eventStore.changes
to see if any values changed in the record.
https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/data/EventStore#property-changes
https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/model/ProjectModel#property-changes
There is no universal answer for all, you can find the way to check that, but you need to have more specific requirements.
Also be aware that renderer triggers only when event needs to be re-rendered.
https://bryntum.com/products/schedulerpro/docs/api/Scheduler/view/mixin/SchedulerEventRendering#config-eventRenderer
All the best,
Alex
Yeah I feared that. My hope was that in:
const eventRenderer = ({
eventRecord,
resourceRecord,
assignmentRecord,
renderData,
}) => {
return (
<EventItem
key={assignmentRecord.id}
eventRecord={eventRecord}
resourceRecord={resourceRecord}
/>
);
};
maybe renderData or eventRecord would pass me the information. But I realized that these are not updated eg on resize and there are anyway no props about "isDragging" "isResizing" "isSelected" etc ...
Hey mightym,
Perhaps using the event listeners like this one https://bryntum.com/products/schedulerpro/docs/api/Core/helper/DragHelper#event-dragStart and handling from there which event is being dragged would do the trick for you?
Best regards,
Márcio