Radscheduler: How to close the advanced edit form and go back to the scheduler week view

1 Answer 36 Views
Scheduler
Jonathan
Top achievements
Rank 1
Jonathan asked on 22 Nov 2024, 08:41 PM

Hello,

 

I have the advanced template setup like so in the radscheduler:

 


                        <AdvancedEditTemplate> 
                        <div class="card" style="padding:10px" >
                            <div class="card-header corpsnet_panelPrimary" style="padding:10px">
                                <strong><h4><asp:Label ID="lblTitle"  runat="server" Text='<%# Bind("RosterDateStringLong") %>' ></asp:Label></h4></strong>
                            </div>
                            <div class="card-body smallscreensection" style="padding:10px">
                                <div class="container">
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           CREW:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label ID="lblCrew" runat="server" Text='<%# Bind("CrewName") %>' ></asp:Label></h5>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>SUPERVISOR:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label ID="Label1" runat="server" Text='<%# Bind("SupervisorUserProfileName") %>' ></asp:Label></h5>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>MEETING POINT (Click for directions):
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title-link"><asp:HyperLink runat="server" ID="hyplnkMeetingPoint" Target="_blank" Text='<%# Bind("MeetingPointDescription") %>' NavigateUrl='<%# Bind("MeetingPointURL") %>' ></asp:HyperLink></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>MEETING/START TIME:
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label  ID="lblStartTime" runat="server" Text='<%# Bind("StartTimeString") %>' ></asp:Label></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>PROJECT:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label  ID="lblProject" runat="server" Text='<%# Bind("Project") %>' ></asp:Label></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-12" >                                           
                                           <asp:Button ID="btnClose" CssClass="btn btn-primary" runat="server" Text="Close" OnClientClick="closeEditForm(); return false;" />
                                        </div>
                                     </div>
                                </div>
                            </div>
                        </div>
                        </AdvancedEditTemplate>                         

I want the close button to revert to the weekview from the edit form.  I can get the form to close but it's then blank.  How do I show the radscheduler weekview view again on close.  here is my closeEditForm javascript function


        function closeEditForm() {
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            scheduler.hideAdvancedForm();
            // Switch the view to Month View
            scheduler.set_selectedView(Telerik.Web.UI.SchedulerViewType.MonthView);
            scheduler.navigateToDate(new Date()); // Optional: Navigate to today's date 
            return false;
        }
thanks!!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Nov 2024, 04:10 PM

Hi Jonathan,

Here is an example of how to programmatically click the Week button of the Scheduler:

        <script>
            function closeEditForm() {
                var scheduler = $find("ctl00_ContentPlaceholder1_RadScheduler1");
                scheduler.hideAdvancedForm();
                // Switch the view to Month View
                $telerik.$(".rsHeaderWeek").click();
                return false;
            }
        </script>

Notes:

  • The set_selectedView method can be used to programmatically change the view, but it is supported only when RadScheduler is bound to a Web Service.
  • Additionally, the navigateToDate method is not part of the RadScheduler API, so switching to a specific date or view must be handled using other available APIs or UI interactions.

    Best Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Jonathan
    Top achievements
    Rank 1
    commented on 30 Dec 2024, 06:19 AM

    Hi Rumen,  this does close the advanced form but the radscheduler does not reappear and the div is empty.
    Vasko
    Telerik team
    commented on 02 Jan 2025, 06:04 AM

    Hello Jonathan,

    Is the AdvancedForm's Modal property set to true? If not, it will create the Edit form as part of the Scheduler, replacing its original rendered HTML, therefore removing the Week button.

    Could you try setting the property to true and see if that will fix the issue?

    Regards,
    Author nickname
    Progress Telerik

    Tags
    Scheduler
    Asked by
    Jonathan
    Top achievements
    Rank 1
    Answers by
    Rumen
    Telerik team
    Share this question
    or