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

How to open a new appointment using code behind

6 Answers 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Khoa Ho
Top achievements
Rank 1
Khoa Ho asked on 15 Sep 2010, 05:13 PM
Hi,

I want to open a new appointment dialog using code behind or javascript, not clicking on the scheduler. I have played around with that but see no luck.

The scenario is that when I click on an external button outside the scheduler, it will open a new appointment dialog with current date.

Thanks,

Khoa

6 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 21 Sep 2010, 09:45 AM
Hello Khoa Ho,

The solution is similar to this help topic. You need to subscribe to the OnClientTimeSlotClick and use the showAllDayInlineInsertForm method. Here's the code:

Javascript:
function insertAppointment() {
            var now = new Date();
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            scheduler.showAllDayInlineInsertForm(now);
        }

ASPX:
<input type="button" name="button1" value="Create Appointment" onclick="insertAppointment()" />

Hope this helps.

Best wishes,
Veronica Milcheva
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
Khoa Ho
Top achievements
Rank 1
answered on 21 Sep 2010, 05:47 PM
Thank you Veronica,

It's still not working. I got this error from Firebug: d("div.rsTopWrap table.rsContentTable", m)[0].tBodies[0].rows[j] is undefined

Thanks,

Khoa
0
Veronica
Telerik team
answered on 24 Sep 2010, 11:40 AM
Hello Khoa Ho,

In the ticket info I see you are using version 2010. 2 826. Is that true?

Could please send me the full code so I can inspect it and help you?

Thank you!

Kind regards,
Veronica Milcheva
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
Wayne Wilson
Top achievements
Rank 1
answered on 22 Feb 2013, 11:54 PM
I am trying to open the new Appointment dialog from a button/or link outside of the RadScheduler. (I also want to edit from a RadGrid listing of said appointments, but I haven't got that far yet). I am still using Q1 2012.

I tried the javascript included in this post (with the RadScheduler name updated) and it doesn't seem to work for me. Is this still the best way to do that in my version? I an new the the RadScheduler and am having a hard time completing what I thought would be a rather easy task...

Thanks,

--Wayne
0
Princy
Top achievements
Rank 2
answered on 25 Feb 2013, 06:55 AM
Hello Wayne,

Please try the following code which works fine for me in Q1 2012 version. Attach the following JavaScript function to the OnClientClicked event of the RadButton. Also you need to set the AutoPostBack property of the RadButton to false.

ASPX:
<telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="false" Text="Create Appointment" OnClientClicked="insertAppointment"></telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function insertAppointment() {
        var now = new Date();
        var scheduler = $find("<%= RadScheduler1.ClientID %>");
        scheduler.showAllDayInlineInsertForm(now);
    }
</script>

Thanks,
Princy.
0
Wayne Wilson
Top achievements
Rank 1
answered on 26 Feb 2013, 02:45 PM
Thanks, I will check that out. It might have been the post-back that was messing me up.

--Wayne
Tags
Scheduler
Asked by
Khoa Ho
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Khoa Ho
Top achievements
Rank 1
Wayne Wilson
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or