Current filter:
                                You should refresh the page.

                                Client-side appointment form for shared resources

                                0

                                This example illustrates how to create an appointment editing form for resource sharing mode using client-side scripting.

                                In this example, popup menu commands are intercepted by JavaScript functions, which create the ASPxClientAppointment for the selected interval and resource or use the client Scheduler’s GetSelectedAppointmentIds and GetAppointmentById methods to obtain the client appointment. After that, the RefreshClientAppointmentProperties method updates the client appointment properties and invokes the scripting appointment form.

                                The scripting appointment editing form consists of two templates – ScriptAppointmentForm.ascx and ScriptRecurrenceForm.ascx. Their code implements the logic required to populate the form’s controls and update the appointment with new values. The ASPxDropDownEdit control with incorporated ASPxListBox control is used to display a list of resources. It enables the user to select multiple resource in a drop-down list with checkboxes.
                                When the button on the form is pressed, one of the following methods of the client scheduler: UpdateAppointment, InsertAppointment, or DeleteAppointment, is called. This method performs a callback using information contained in the client appointment. The appointment is then processed on the server.

                                Note that ASPxScheduler versions prior to 9.2.10 demonstrates erroneous behavior of the client-side appointment form concerning the recurrence pattern. Custom fields are not updated when the client form is invoked to edit the series. It is reported as issue Client-side appointment editing form - Custom field isn't updated in recurrence pattern.

                                You must  log in  or  register  to leave comments
                                Show Implementation Details

                                The HolidayBaseCollection class now resides in the DevExpress.Schedule namespace, the HolidayCollectionXmlPersistenceHelper class resides in the DevExpress.Schedule.Serializing namespace.

                                Select file
                                • AppointmentDragToolTip.ascx
                                • AppointmentDragToolTip.ascx.cs
                                • AppointmentForm.ascx
                                • CustomAppointmentForm.cs
                                • CustomEvents.cs
                                • CustomResources.cs
                                • DataHelper.cs
                                • Default.aspx
                                • Default.aspx.cs
                                • DemoUtils.cs
                                • ScriptAppointmentForm.ascx
                                • ScriptAppointmentForm.ascx.cs
                                • ScriptRecurrenceForm.ascx
                                • ScriptRecurrenceForm.ascx.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2010 vol 2.3 - v2012 vol 2.8
                                • v2009 vol 2.4 - v2010 vol 1.12
                                <%@ Control Language="C#" AutoEventWireup="true" CodeFile="AppointmentDragToolTip.ascx.cs" Inherits="UserForms_AppointmentDragToolTip" %>
                                <%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2" Namespace="DevExpress.Web.ASPxEditors"
                                    TagPrefix="dxe" %>
                                
                                <div style="white-space:nowrap;">
                                    <dxe:ASPxLabel ID="lblInterval" runat="server" Text="CustomDragAppointmentTooltip" EnableClientSideAPI="true">
                                        </dxe:ASPxLabel>
                                    <br />
                                    <dxe:ASPxLabel ID="lblInfo" runat="server" Text="Press ESC to cancel operation" EnableClientSideAPI="true"></dxe:ASPxLabel>
                                </div>
                                
                                <script id="dxss_ASPxClientAppointmentDragTooltip" type="text/javascript"><!--
                                    ASPxClientAppointmentDragTooltip = _aspxCreateClass(ASPxClientToolTipBase, {
                                        CalculatePosition: function(bounds) {
                                            return new ASPxClientPoint(bounds.GetLeft(), bounds.GetTop() - bounds.GetHeight());
                                        },
                                        Update: function (toolTipData) {
                                            var stringInterval = this.GetToolTipContent(toolTipData);
                                            var oldText = this.controls.lblInterval.GetText();
                                            if (oldText != stringInterval)
                                                this.controls.lblInterval.SetText(stringInterval);
                                        },
                                        GetToolTipContent: function(toolTipData) {    
                                            var interval = toolTipData.GetInterval();
                                            return this.ConvertIntervalToString(interval);
                                        }
                                    });
                                //--></script>