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

RadScheduler Appointment Template

3 Answers 106 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Jillian
Top achievements
Rank 1
Jillian asked on 13 Jun 2012, 01:32 PM
I am using a RadScheduler control in a MVC application, using a web service.  I am trying to change the appointment template.  I have followed this demo: http://demos.telerik.com/aspnet-ajax/scheduler/examples/webservice/defaultvb.aspx, but am getting this javascript error when trying to debug: "Microsoft JScript runtime error: Object doesn't support property or method 'tmpl'"

This error occurs on this line of code:
$("#tmplAppDescription").tmpl(tmplValue).insertBefore(this);

Here is my code.  As far as I can see I have included everything I should need for this to run correctly.  What is causing the javascript error?

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            <asp:ScriptReference Path="~/Scripts/jquery.tmpl.js" />
        </Scripts>
    </telerik:RadScriptManager>
 
     <telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="WeekView" 
        StartEditingInAdvancedForm="False" EnableDescriptionField="True" Height="600px" 
        AppointmentStyleMode="Default" Skin="WebBlue" OnClientDataBound="onSchedulerDataBound" >
        <WebServiceSettings Path="../../SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" />
    </telerik:RadScheduler>

<script id="tmplAppDescription" type="text/x-jquery-tmpl"><div style='font-style:italic;'>${Description}</div></script>
<script type="text/javascript">
    function onSchedulerDataBound(scheduler) {
        var $ = jQuery;
        $(".rsAptDelete").each(function () {
            var apt = scheduler.getAppointmentFromDomElement(this);
            var tmplValue = { Description: apt.get_description() };
            $("#tmplAppDescription").tmpl(tmplValue).insertBefore(this);
        });
    }
</script>

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 18 Jun 2012, 08:21 AM
Hello Jillian,

It seems that the "jquery.tmpl.js" script file is not included in the project. I am attaching a runnable web site with the code of the demo that contains this "js" file as well.

Hope this will be helpful.

 

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jillian
Top achievements
Rank 1
answered on 28 Jun 2012, 05:43 PM
I do have the jquery.tmpl.js script file attached.  It is in my Scripts folder - the path that my scripts reference is pointing to.  Yet I am still getting the "Microsoft JScript runtime error: Object doesn't support property or method 'tmpl'" error
0
Plamen
Telerik team
answered on 29 Jun 2012, 01:11 PM
Hello Jillian,

 
Would you please share with what is your project different from the one attached in the previous post so that we can be able to reproduce the same behavior locally and be more helpful?

All the best,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Jillian
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Jillian
Top achievements
Rank 1
Share this question
or