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

Scheduler ResourceHeaderClickJavaScript

Asked by Jose Miguel Icaza
1 year ago.

Need room name or id to pass to the modal screen

Answer posted by Dan Letecky [DayPilot]
1 year ago.

I recommend using RowClickJavaScript instead. It handles the JavaScript onRowClick event:
https://api.daypilot.org/daypilot-scheduler-onrowclick/

You can access the resource id using args.row.id there:

<DayPilot:DayPilotScheduler
  RowClickHandling="JavaScript"
  RowClickJavaScript="console.log('id', args.row.id);"
  ...
/>
Comment posted by Jose Miguel Icaza
1 year ago.

Thank you Dan,

I couldn't make it work
The only combination that works for me is:

ResourceHeaderClickHandling="JavaScript"
ResourceHeaderClickJavaScript="ChangeRoom(2);"

I just need to replace the (2) for a anything I could identify the row, to calculate the roomid

Comment posted by Dan Letecky [DayPilot]
1 year ago.

In ResourceHeaderClickJavaScript, you can use "resource.value" to get the resource id:

ResourceHeaderClickJavaScript="ChangeRoom(resource.value);"
Comment posted by Jose Miguel Icaza
1 year ago.

I got it. Thanks much for your help Dan.

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