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

How do I hook into when the user clicks a date in the Navigator?

Asked by Scott Mitchell
11 years ago.

I have a view with a Scheduler and Navigator. When the user clicks a date in the Navigator the Scheduler is updated via Ajax, as by design.

However, what I'd like to do is when the user clicks a date in the navigator I want to send them to another page. Is there a way I can hook into when the user clicks the navigator, ideally through JavaScript, so that I can send the user to another page?

Also, I noticed that if I click a date on the Navigator it is highlighted a certain color (depending on the theme I'm using). However, if I initialize the Navigator by setting the StartDate to a certain date, the Navigator shows the month/year of the specified date, but the date itself is not highlighted like when it is clicked. How do I have the date highlighted by virtue of having the StartDate property set?

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

You need to handle TimeRangeSelected event manually:

TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "yourHandler(start, end);"

If you want to update the main control you need to call commandCallBack():

function yourHandler(start, end) {
  dps.commandCallBack("navigate", {start:start});
}

See also:
http://api.daypilot.org/daypilot-navigator-ontimerangeselected/
http://kb.daypilot.org/61736/how-to-bind-navigator-to-multiple-controls/

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

You can select the date using SelectionStart property. The full selection range will be determined automatically depending on SelectMode:

SelectionStart = DateTime.Today,

On the client side, it's possible to call select():

http://api.daypilot.org/daypilot-navigator-select/

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