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

RadScheduler - Add Task from external button click

3 Answers 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shamanth
Top achievements
Rank 1
Shamanth asked on 11 Mar 2014, 06:25 AM
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 .

3 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 13 Mar 2014, 04:47 PM
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.

 
0
Shamanth
Top achievements
Rank 1
answered on 14 Mar 2014, 05:15 PM
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?

0
Hristo Valyavicharski
Telerik team
answered on 19 Mar 2014, 04:29 PM
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.

 
Tags
General Discussions
Asked by
Shamanth
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Shamanth
Top achievements
Rank 1
Share this question
or