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

Create a new Resource booking in schedule by clicking on schedule date

Asked by John
14 years ago.


I'm trying to setup the facility for a client to book a resource by clicking on specific day for a resource in the scheduler view. I use, so I'm finding the examples in C#/javascript a little hard to follow.

Do I have to use Javascript to achieve this functionality?

Whats the easiest way to achive this? Using events or javascript?

I've tried but when I click on empty space nothing happens. When I click on an event I get "Microsoft JScritp runtime error: 'start' is undefined"

Comment posted by John
14 years ago.

Just noticed that I was using "EventClickJavaScript" instead of "TimeRangeSelectedJavaScript" in the schedular code.

So now nothing comes up when I click on an event, but the same "'Start' is undefined" error comes up when I click on an empty cell...


Answer posted by John
14 years ago.


I tried using

TimeRangeSelectedHandling= "JavaScript"
TimeRangeSelectedJavaScript = "openPopup(start, end, column);"

and this as per example on site

function openPopup(e)
+ DayPilot.ds(start)
+ '&end=' + DayPilot.ds(end)
+ '&column=' + column,

This didnt work, got the error above.

I then tried another example

function newEvent(start, end, column)
document.location = 'bookingPopupNew.aspx?start='
+ encodeURIComponent(start.toUTCString())
+ '&end=' + encodeURIComponent(end.toUTCString())
+ '&column=' + encodeURIComponent(column);

This worked!

So I put it together into a dialog box showing details

function newBooking(start, end, column)
+ encodeURIComponent(start.toUTCString())
+ '&end=' + encodeURIComponent(end.toUTCString())
+ '&column=' + encodeURIComponent(column),

This works fine.

Can a VB examples section be put up on the site?



Comment posted by Dan Letecky
14 years ago.
Oops, there was a typo in the example - it's fixed now. The openPopup() header should be

  function openPopup(start, end, column) {

rather than

  function openPopup(e) {

Thanks for posting the solution.

I'm working on the features documentation (DayPilotMonth and DayPilotScheduler are in progress now) and as soon as it's done I would like to add the VB.NET examples as well. Thanks for reminding this.
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.