RadScheduler Appointment Template

Thread is closed for posting
4 posts, 0 answers
  1. Jillian
    Jillian avatar
    16 posts
    Member since:
    Aug 2011

    Posted 13 Jun 2012 Link to this post

    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>
  2. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 18 Jun 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jillian
    Jillian avatar
    16 posts
    Member since:
    Aug 2011

    Posted 28 Jun 2012 Link to this post

    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
  5. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 29 Jun 2012 Link to this post

    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.
Back to Top