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

How to highlight the row header (resource) after range selection

Asked by Anonymous
1 month ago.

Hi,
Is it possible to highlight the resource with current time range selection?

And which event I should listen to in order to get the selected day? I'm looking for an event, that works in every scenario. E. g. if a day is disabled, then I can't use onTimeRangeSelected

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

You should take a look at the dynamic onTimeRangeSelecting event:
https://api.daypilot.org/daypilot-scheduler-ontimerangeselecting/

It will let you highlight the current resource using args.row.addClass():
https://api.daypilot.org/daypilot-row-addclass/

The built-in support for disabled cells doesn't fire onTimeRangeSelect/ed events. However, you can use onTimeRangeSelecting to implement your own logic - that would allow the onTimeRangeSelect/ed events to be fired.

Comment posted by Anonymous
1 month ago.

The issue with onTimeRangeSelecting, is that it keeps firing as long as Iong as I'm selecting. So, how can I listen to it, once the mouse is released?

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

When the mouse is released, the Scheduler fires onTimeRangeSelect and onTimeRangeSelected.

These events won't be fired if the selection is forbidden because of disabled cells. If you want to block certain cells but still allow onTimeRangeSelect to be fired, you can turn off the built-in disabled cells implementation and implement your own using onTimeRangeSelecting - you can either change the selection color or display a label using args.right.html, etc.

This way you can provide feedback for your disabled cells but still use onTimeRangeSelect (e.g. to highlight the resource).

New Reply
This reply is
Your name (optional):