This is a migrated thread and some comments may be shown as answers.

Calendar and window integration issue

1 Answer 18 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 25 Oct 2008, 11:20 AM
Hi, I have a RadCalendar (ajax q2) that I am assigning different event descriptions via the Dayrender Event as shown below. The goal is to show a RadWindow that receives the EventID of the clicked day (eventID being something unique in our system). I have tried to do this by adding a .Attributes.Add onclick along with associated javascript as shown below. However, what happens when I click an Event is that the window initially opens but then closes after postback. All I want is for the window to stay open after postback. Any thoughts on how to achieve this? Many thanks.

// Javascript function (assumes rwm is a radwindow manager on page
function launchAgenda(EventID)
{
  var oWnd = $find("<%= rwmAgenda.ClientID %>");  
  oWnd.show();  
  oWnd.setSize(900,700);  
  oWnd.moveTo(10,10);
  oWnd.setUrl("Faculty/Agenda.aspx?EID=" + EventID);
}
</script>

' Visual Basic DayRender sub
  Public Sub CustomizeDay(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) Handles RadCalendar1.DayRender
        Dim CurrentDate As DateTime = e.Day.Date
        Dim currentCell As TableCell = e.Cell
        Dim d As CalendarDay
        Dim c As TableCell
Dim EventID as Integer = 52
 
                    Dim EventDesc As String = "my event"
                    currentCell.Text = EventDesc
                    currentCell.Attributes.Add("onclick", "launchAgenda(" & EventID.ToString & ")")

    End Sub 'CustomizeDay

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 28 Oct 2008, 09:07 AM
Hello Karl,

If you want to keep the window instance after it is opened for a particular cell open and initiating a postback request, you will need to find a way to re-invoke the launchAgenda(EventID) client method the response is received back from the server.  This strictly depends on your custom logic, that is why I am not able to provide a definite solution/code snippet for your case. Let me know if I am missing something.

Kind regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Karl Wilkens
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or