RadScheduler - Add Task from external button click

4 posts, 0 answers
  1. Shamanth
    Shamanth avatar
    2 posts
    Member since:
    Mar 2014

    Posted 11 Mar 2014 Link to this post

    Hi,

    Please tell me how to do:

    1) When we right click on the RadScheduler, we get "New Appointment" option from the context menu, how can we invoke that menu from button click outside the RadSchedular control.
    2) ON Click of a button outside a RadSchedular, how to get a selected dates from the Scheduler control.

    Please point me to appropriate samples/code .
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 13 Mar 2014 Link to this post

    Hi Shamanth,

    The selected data could be retrieved with the following javascript:
    $find('RadScheduler1').get_selectedDate();

    Displaying a "New Appoint" will be a bit tricky. First you will have to get any time slot. Then display the new appointment for it.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. Shamanth
    Shamanth avatar
    2 posts
    Member since:
    Mar 2014

    Posted 14 Mar 2014 in reply to Hristo Valyavicharski Link to this post

    Hi Hristo,

    Thanks for your reply.
    I did try this option and as you mentioned its very tricky in getting the selected time slot to open the "Add Appointment" screen.
    I tried the following code:
     <script type="text/javascript">
            //Put your JavaScript code here.
            function OpenDialog() {
                var Scheduler = $find("<%= RadScheduler1.ClientID %>");
                //alert("get_currentAppointment() : " + Scheduler.get_currentAppointment());
                alert("get_selectedDate() : " + Scheduler.get_selectedDate());
                //alert("get_selectedSlots() : " + Scheduler.get_selectedSlots());
                //alert("get_targetSlot() : " + Scheduler.get_targetSlot()); //Not working
                //alert("showInlineInsertForm : " + showInlineInsertForm()); //Not working
            }
        </script>

    So for the same requirement I have another idea i.e. adding buttons to the Footer of the RadScheduler, Is this possbible?
    This way we will be in RadScheduler context, Will this help?

  4. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 19 Mar 2014 Link to this post

    Hi Shamanth,

    The Scheduler doesn't have footer templates. Handle the OnClientTimeSlotClick event to get the selected slot and try with this code:

    <script type="text/javascript">
        var timeSlot;
        function OnClientTimeSlotClick(sender, args) {
            timeSlot = args.get_targetSlot();
        }
     
        function buttonClick() {
            var scheduler = $find('RadScheduler1');
            scheduler.showInsertFormAt(timeSlot);
        }
     
    </script>


    Regards,
    Hristo Valyavicharski
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top