AJAX Calendar/Scheduling Controls
Hi I currently am using the open source version of the DayPilotScheduler control which I really like, but I am unclear on how I can pass the DataValueField which in my case is called "EventID" through to javascript function. I tried the following :
<DayPilot:DayPilotScheduler ID="DayPilotScheduler2" runat="server" DataStartField="StartDate" DataTextField="Subject" DataValueField="EventID" DataEndField="EndDate" DataResourceField="StaffID" BackgroundColour="backgroundColour" Width="100%" Days="1" BusinessBeginsHour="9" BusinessEndsHour="18" CellDuration="60" CellWidth="69" RowHeaderWidth="157" TimeFormat="Clock12Hours" Enabled="True" FreeTimeClickHandling="JavaScript" EventClickHandling="JavaScript" ViewStateMode="Enabled" ShowToolTip="True" EventClickJavaScript="loadEdit('{0}');" FreeTimeClickJavaScript="loadEdit('{0}');" ondatabinding="DayPilotScheduler2_DataBinding" />
but {0} seems to only be the subject. and {1} would be empty.
many thanks .
{0} should get replaced with the DataValueField value (EventID in your case). See the following code snippets:
string val = DataBinder.GetPropertyValue(dataItem, DataValueField, null); // ... ((ArrayList)ViewState["Items"]).Add(new Event(val, start, end, name, resourceId));,
public Event(string pk, DateTime start, DateTime end, string name, string resource) { this.PK = pk; this.Start = start; this.End = end; this.Name = name; this.Resource = resource; }
output.AddAttribute("onclick", "javascript:event.cancelBubble=true;" + String.Format(EventClickJavaScript, p.PK));
DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java