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

Prevent Time Range Selections

Asked by Jeremy
15 years ago.

One last question then I'll leave you alone :-)

In the scheduler is there an easierway to conditionally prevent a user from selecting an cell in the TimeRangeSelected event than calling my server side code to validate on each TimeRangeSelected event? I read the following post (about a year old): http://forums.daypilot.org/Topic.aspx/333/disabling_the_click_event_for_creating_new_eventsbut it requires server side validation.I am trying to prevent the user from selecting invalid time slots based of certain conditions. Ican successfully change the background color of the cell in the BeforeCellRender event to visually indicate this is an invalid selection. But that is only a visual indicator...the cell itself of course is still functional. I was hoping that I could simply check the background color on the TimeRangeSelected event viaJavaScriptbut unfortunetly it's not available. I do see an interesting property on TimeRangeSelected called"data" which is a Json.JsonData type but is always null. Can I use this somehow?

I know I can accomplish this based off the post above, but if I could just simply compare cell background colors or some custom data returned in the TimeRangeSelected eventit would save from a cosltly database call.

Thanks for your time!

Comment posted by Dan Letecky
15 years ago.

Hi Jeremy,

Sorry for the delay. At this moment, it's not possible to hook the time range selection before it's actually finished. Even the client-side methods are executed when it's done. I will give it a thought, there are several ways to solve this. I guess the most straightforward one is to have an extra "Selectable" attribute for background cells.

Comment posted by SigdevJim
15 years ago.
Hi, I would be interested in a feature like this too. I want to create a kind of 'shadow' schedule which will define what cells are available for selection in the user interface. It would be great to be able to even show this on another month view. Is that possible? How would I do this? Many thanks Jim
Comment posted by Dan Letecky
15 years ago.

This sounds like a good idea. I'm adding it to the requirements list - please give me some time to think it over.

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