Issue in EventClickJavaScript
Event Render
I got some issue at EventClickJavaScript.
The code below assigning the EventClickJavaScript property based e.value.
Example:
A person got Ticket and Opertunity in same day.
Case 1
Time URL type
10.00am Ticket
11.00am Opertunity
15.20pm Ticket
The above 3 event if I click its redirecting URL Ticket page ("document.location='wfTicket.aspx?id=' + e.value()") which is last type. But its not redirecting Opertunity page (document.location= Opertunity.aspx?ID=' + e.value()").
Case 2
Time URL type
10.00am Opertunity
11.00am Ticket
15.20pm Opertunity
The above 3 event if I click its redirecting URL Opertunity page (document.location= Opertunity.aspx?ID=' + e.value()") which is last type. But its not redirecting Ticket page ("document.location='wfTicket.aspx?id=' + e.value()").
I assume its over Overwriting with latest URL.
The following items working fine:
Tooltips shows differently like ticket and opertunity in same day
Leftbar color changing
InnerHTML
Please me to fix the issue. We need to lunch the project very soon. Please refer the code below:
// Loading Each events with address, name, and event type when render each events.
private void DPC_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
DayPilotCalendar d = sender as DayPilotCalendar;
string strVal = "";
if (null != d)
{
DataSet dsEvent = (DataSet)d.DataSource;
DataRow drEvent = dsEvent.Tables[0].Rows.Find(e.Value);
if (drEvent != null)
{
strVal = drEvent["id"].ToString() + ", " +
drEvent["name"].ToString() + ", ";
if (drEvent["a1"].ToString().Length > 0)
strVal = strVal + drEvent["a1"].ToString() + ", ";
if (drEvent["a2"].ToString().Length > 0)
strVal = strVal + drEvent["a2"].ToString() + ".";
}
if (e.Value.Substring(0, 1).ToLower() == "t")
{
d.EventClickJavaScript = "document.location='wfTicket.aspx?id=' + e.value()";
e.ToolTip = "Ticket";
e.LeftBarColor = "blue";
e.InnerHTML = strVal;
}
else
{
e.LeftBarColor = "red";
e.ToolTip = "Opertunity";
e.InnerHTML = strVal;
d.EventClickJavaScript = "document.location= Opertunity.aspx?ID=' + e.value()";
}
}
} //DPC_BeforeEventRender
Asked by Anonymous 4 years ago.