The resource() method returns the current event resource identifier or sets a new one.
DayPilot.Event.resource()
DayPilot.Event.resource(newResource)The new value is applied when you call DayPilot.Scheduler.events.update().
newResource (string) - new event resource identifier.
Call the method without parameters to read the current resource id. Call it with a value to update the event object before saving it back to the control.
const oldResource = e.resource();
e.resource("B");