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

How to get resource name instead of ID

Asked by Michal Bachtin
3 years ago.

Hi guys,

I am looking for a way how to obtain in method onMove in Scheduler Name of the original Resource and NewResource. I know how to get ID, but didnt found a way for Name.

The goal is to allow my client move event only between resources with same name in original and new resource.

I found this 10y old topic (https://forums.daypilot.org/question/921/scheduler_resource_name_and_id). Does exists another way?

Thanks a lot, Michal

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

You can get the row object (DayPilot.Row) using rows.find():

dp.onEventMove = function(args) {
  var row = dp.rows.find(args.newResource);
  // ...
};

It's also possible to use onEventMoving instead to block the target position in real time:
https://doc.daypilot.org/scheduler/event-moving-customization/
https://api.daypilot.org/daypilot-scheduler-oneventmoving/

Comment posted by Michal Bachtin
3 years ago.

Excelent! The onEventMoving looks as the best way! Thank you Dan.

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