search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Can't get resource.

Asked by JC
3 years ago.

So this code works:

dp.onEventMoving = function(args) {
alert(args.start + " " + args.end + " " + args.resource);
};

The args.resource returns the column resource id: g1

BUT when I use this, I get undefined for all 3 props above.

dp.onEventMoved = function (args) {
alert(args.start + " " + args.end + " " + args.resource);
}

Obviously the event moved ends up triggered after and once event is set in either existing column or new one. I want to pick up whatever resource it ends up in.

Make sense?

J

Comment posted by Dan Letecky [DayPilot]
3 years ago.

The args.start, args.end and args.resource properties should never be undefined in onEventMoved.

You might want to check your onEventMove handler which is fired first. If it doesn't help, can you please post an example that reproduces the problem?

Comment posted by JC
3 years ago.

Is there someone I can email directly (vs. public) with the code/example?

Comment posted by Dan Letecky [DayPilot]
3 years ago.

Yes, you can send it to support@daypilot.org.

Answer posted by Dan Letecky [DayPilot]
3 years ago.

Sorry for the confusion: In onEventMoved, you need to use args.newStart, args.newEnd, args.newResource instead.

See also:
https://api.daypilot.org/daypilot-scheduler-oneventmoved/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.