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

How to clear time range selection in OnTimeRangeSelected with TimeRangeSelectedHandlingType.Callback

Asked by Anonymous
4 years ago.

I have some constraints when selecting a timerange to create an event. It clears selection if it pass these constraints, but if not I can't clear the selection.

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

Normally the time range selection gets cleared if you call Update() on the server side.

If you don't do that for some reason you need to switch to JavaScript event handling and clear it manually:

  TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.Callback,
  TimeRangeSelectedJavaScript = "dp.clearSelection(); dp.timeRangeSelectedCallBack(start, end, resource);"

Where "dp" is the Scheduler object on the client side (ID).

It clears the selection:

dp.clearSelection();

And than it invokes the server-side event handler:

dp.timeRangeSelectedCallBack(start, end, resource);"

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