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
2 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 ( Does exists another way?

Thanks a lot, Michal

Answer posted by Dan Letecky [DayPilot]
2 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:

Comment posted by Michal Bachtin
2 years ago.

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

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