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

Popup Window

Asked by Dragan
12 years ago.

I use this code but don't popup the PopupNew.aspx giv me this error: Microsoft JScript runtime error: 'start' is undefined, i don't know where i make mistake? Can you help me what i need to write in code?:

<%@ Page Title="" Language="C#" MasterPageFile="~/Pocetna.Master" AutoEventWireup="true" CodeBehind="Events.aspx.cs" Inherits="Rezervacii.Events" %>
<%@ Register assembly="DayPilot" namespace="DayPilot.Web.Ui" tagprefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
function openPopup(start, end, column) {
window.open('PopupNew.aspx?start=' + DayPilot.ds(start) + '&end=' + DayPilot.ds(end) + '&column=' + column, 'NewEvent', 'width=400,Height=400,top=200,left=200');
}

</script>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
BusinessEndsHour="19" DataEndField="eventend" DataStartField="eventstart"
DataTextField="name" DataValueField="id" Days="7" TimeFormat="Clock24Hours"
TimeRangeSelectedHandling="JavaScript"
onbeforeeventrender="DayPilotCalendar1_BeforeEventRender"
TimeRangeSelectedJavaScript="openPopup(start, end, column);" />
</asp:Content>

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

In the Lite version, the start, end, and column variables are not available in TimeRangeSelectedJavaScript.

You need to use {0} and {1} strings:

  • {0} will get replaced by the time range start and
  • {1} will get replaced by the resource id

Example:

TimeRangeSelectedJavaScript="openPopup('{0}', '{1}');"

And:

function openPopup(start, column) { 
  window.open('PopupNew.aspx?start=' + start + '&column=' + column, 'NewEvent', 'width=400,Height=400,top=200,left=200'); 
}
Comment posted by Dan Letecky [DayPilot]
12 years ago.

Update: {1} is only available in DayPilotScheduler.TimeRangeSelectedJavaScript.

DayPilotCalendar doesn't support custom columns in the Lite version.

Comment posted by Dragan
12 years ago.

Ok thank you, i solved this like you write in the code, now when i click in the calendar in the popup window display only date, how to display date and clock in this format, 19.09.2012 13:30:15 ? What i need to write in code?

Comment posted by Dragan
12 years ago.

With this line only display date 19.09.2012:
TextBoxStart.Text = Convert.ToDateTime(Request.QueryString["start"]).ToShortDateString();

Comment posted by Dragan
12 years ago.

ok , i solved :)

TextBoxStart.Text = Convert.ToDateTime(Request.QueryString["start"]).ToShortDateString() + Convert.ToDateTime(Request.QueryString["start"]).ToLongTimeString();

Comment posted by Anj123
11 years ago.

How to capture end in Lite version?

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