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

External edit in rad dock with radajaxmanager

5 Answers 113 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jonathan Levy
Top achievements
Rank 1
Jonathan Levy asked on 15 Apr 2009, 02:24 PM
hi

I'm trying to use this example but without the update panels. I'm trying to use the radajaxmanager but it doesn't work. I've copied the code from the example and put it into my page but the external edit window doesn't popup.

Do you have any examples of how to do this with radajaxmanager? I have pasted the code that I think is important below.

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadScheduler1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="DiaryEventsMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerAppointmentContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerTimeSlotContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="DiaryEventsMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerAppointmentContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerTimeSlotContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadDock1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadDock1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 



function

 

openForm() {

 

 

var dock = $find('<%=RadDock1.ClientID %>');

 

 

// Center the RadDock on the screen

 

 

var viewPort = $telerik.getViewPortSize();

 

 

var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);

 

 

var yPos = Math.round((viewPort.height - parseInt(dock.get_height())) / 2);

 

$telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });

dock.set_closed(

false);

 

Sys.Application.remove_load(openForm);

}

 

function hideForm() {

 

 

var dock = $find("<%=RadDock1.ClientID %>");

 

dock.set_closed(

true);

 

 

return true;

 

}

 

function dockMoved(sender, args) {

 

 

//Return RadDock to his original HTML parent so it gets updated via ajax

 

$get(

"<%=DockPanel.ClientID %>").appendChild(sender.get_element());

 

}

 

 

 

<div id="errors">

 

 

</div>

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="100%" Height="100%"

 

 

DayStartTime="07:00:00" DayEndTime="19:00:00" DataKeyField="ID" DataSubjectField="Subject"

 

 

DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"

 

 

Culture="en-GB" DayHeaderDateFormat="dddd, dd MMMM yyyy" DataRecurrenceParentKeyField="RecurrenceParentID"

 

 

OnFormCreating="RadScheduler1_FormCreating" StartEditingInAdvancedForm="false">

 

 

<AppointmentTemplate>

 

 

<asp:Panel ID="AppointmentContainer" runat="server">

 

 

<table cellpadding="0" cellspacing="0" border="0">

 

 

<tr style="vertical-align: top;">

 

 

<td class="icon">

 

 

<asp:ImageButton ID="ImageButtonMoreInfo" ImageUrl="~/App_Themes/HP25/Images/magnify.png"

 

 

OnClientClick="onButtonClick(this,event);" runat="server" AlternateText="Click for more info" />

 

 

</td>

 

 

<td class="text">

 

 

<asp:Label ID="Subject" runat="server" />

 

 

</td>

 

 

</tr>

 

 

<tr id="PropertyRow" runat="server" style="vertical-align: top;">

 

 

<td class="icon">

 

 

<asp:Image ID="PropertyIcon" AlternateText="Property Address" ImageUrl="~/App_Themes/HP25/Images/house.png"

 

 

runat="server" />

 

 

</td>

 

 

<td class="text">

 

 

<asp:Label ID="Property" runat="server" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</asp:Panel>

 

 

</AppointmentTemplate>

 

 

<DayView HeaderDateFormat="dddd, dd MMMM yyyy" />

 

 

</telerik:RadScheduler>

 

 

Protected Property EditedAppointmentID() As Object

 

 

Get

 

 

Return ViewState("EditedAppointmentID")

 

 

End Get

 

 

Set(ByVal value As Object)

 

ViewState(

"EditedAppointmentID") = value

 

 

End Set

 

 

End Property

 

 

Protected Sub PopulateEditForm(ByVal editedAppointment As Appointment)

 

 

Dim app = FindAppointmentById(editedAppointment.ID, Appointments)

 

TextBoxDescription.Text = app.Description

TextBoxSubject.Text = app.Subject

 

End Sub

 

 

Protected Sub RadScheduler1_FormCreating(ByVal sender As Object, ByVal e As SchedulerFormCreatingEventArgs)

 

 

If e.Mode = SchedulerFormMode.Insert OrElse e.Mode = SchedulerFormMode.Edit Then

 

EditedAppointmentID = e.Appointment.ID

e.Cancel =

True

 

ScriptManager.RegisterStartupScript(

Me, [GetType](), "formScript", "Sys.Application.add_load(openForm);", True)

 

PopulateEditForm(e.Appointment)

 

End If

 

 

End Sub

 



Thanks
Jon

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 Apr 2009, 09:32 AM
Hello Jonathan,

Please, try the following RadAjaxManager settings with the online demo:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="DockPanel$RadDock1$C$SubmitButton">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="DockPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 

Also, delete "return" from the OnClientClick handler of the submit button:
* * *  
<asp:Button runat="server" ID="SubmitButton" Text="Update" OnClick="SubmitButton_Click" 
                                        OnClientClick="return hideForm()" /> 
 
* * * 

Let us know if you have further questions.

Regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
René Hézser
Top achievements
Rank 1
answered on 19 May 2010, 02:06 PM
> Also, delete "return" from the OnClientClick handler of the submit button:

It took me an hour to resolve this :-(
0
ChrisC.
Top achievements
Rank 2
answered on 15 Sep 2010, 08:06 PM

Hello,
This thread has proved to be very helpful.  I had the exact same problem trying to incorporate the External Edit Demo into RadAjaxManager.

I have an additional problem related to the External Edit Demo.

When I add the Raddock and accompanying javascript, the Radpanelbar I'm using for navigation stops responding to item clicks.
Here's the kicker though; if I double click an appointment in the Scheduler and make sure all the controls on the raddock form are populated, then click Cancel or Update, magically the Radpanelbar begins responding to item clicks.  If, for some reason, the Raddock is missing any information, the Radpanelbar will not respond.

I'm thinking it has something to do with my RadAjaxManager configuration, but I'm lost as of now.  Please help.

Edit:
Forgot to mention that I am using a Master Page, and all controls are in the Conent Page.

 

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest"  

    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />  

    <AjaxSettings 

        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  

            <UpdatedControls 

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 

            </UpdatedControls>

       </telerik:AjaxSetting>

        <telerik:AjaxSetting AjaxControlID="RadPanelBar1">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="RadPanelBar1" />  

                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />  

            </UpdatedControls 

        </telerik:AjaxSetting 

        <telerik:AjaxSetting AjaxControlID="timescale">  

            <UpdatedControls 

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />  

            </UpdatedControls>

        </telerik:AjaxSetting>

        <telerik:AjaxSetting AjaxControlID="RadGrid1">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />

            </UpdatedControls>

        </telerik:AjaxSetting>

        <telerik:AjaxSetting AjaxControlID="RadScheduler1">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="DockPanel" />

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />

            </UpdatedControls>

        </telerik:AjaxSetting>

        <telerik:AjaxSetting AjaxControlID="DockPanel$RadDock1$C$SubmitButton">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />

            </UpdatedControls>

        </telerik:AjaxSetting>

    </AjaxSettings>

</telerik:RadAjaxManager>

 

0
Peter
Telerik team
answered on 21 Sep 2010, 10:11 AM
Hi ChrisC.,

This could be a problem related to validation. Can you try setting ValidationGroup="none" for RadPanelbar and let me know if this helps.


Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ChrisC.
Top achievements
Rank 2
answered on 21 Sep 2010, 10:48 AM
That was exactly the problem!  Thanks!
Tags
Scheduler
Asked by
Jonathan Levy
Top achievements
Rank 1
Answers by
Peter
Telerik team
René Hézser
Top achievements
Rank 1
ChrisC.
Top achievements
Rank 2
Share this question
or