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

ical Export Script Error

5 Answers 36 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 09 Feb 2016, 03:29 PM

following the demo here - http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx

 I get a script error on ": 'demo' is undefined" on "demo.ajaxManager = $find("ctl03_RadAjaxManager1")"

here is the script:

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
            <script type="text/javascript">
                /* <![CDATA[ */
                Sys.Application.add_load(function () {
                    demo.ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                });
                /* ]]> */
                (function () {
                    var demo = window.demo = window.demo || {};

                    window.Export = function (sender, e) {
                        demo.ajaxManager.__doPostBack(sender.name, "");
                    }
                }());
            </script>
        </telerik:RadScriptBlock>

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 12 Feb 2016, 09:24 AM
Hi,

I have tested the code provided and it worked correctly at my side. You may declare the demo with the following line immediately before the error line at your side to avoid it from happening:
var demo = window.demo = window.demo || {};


Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
david
Top achievements
Rank 1
answered on 12 Feb 2016, 02:27 PM

Hi Plamen, thank you for your reply. I added the declaration and now it fails:

 

Unhandled exception at line 12, column 21 in script block
0x800a138f - JavaScript runtime error: Unable to get property '__doPostBack' of undefined or null reference

 on this

 /* <![CDATA[ */
            Sys.Application.add_load(function () {
                var demo = window.demo = window.demo || {};
                demo.ajaxManager = $find("ctl03_RadAjaxManager1");
            });
            /* ]]> */
            (function () {
                var demo = window.demo = window.demo || {};

                window.Export = function (sender, e) {
                    demo.ajaxManager.__doPostBack(sender.name, "");
                }
            }());

 

0
Plamen
Telerik team
answered on 15 Feb 2016, 07:05 AM
Hi,

I am attaching a sample page that worked correctly at my side. Hope this will help you solve the issue.

Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
david
Top achievements
Rank 1
answered on 15 Feb 2016, 04:02 PM

Hi Plamen,

So I was able to get it to work by removing the RadAjaxManagerProxy, I recall I added the RadAjaxManagerProxy to resolve another problem (http://www.telerik.com/account/support-tickets/view-ticket?threadid=961358)

Is there a reason this should not work?

telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadScheduler1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1"
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

0
Plamen
Telerik team
answered on 18 Feb 2016, 07:55 AM
Hi,

It worked correctly at my side with RadAjaxManagerProxy too. I am attaching the updated page.

Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
david
Top achievements
Rank 1
Answers by
Plamen
Telerik team
david
Top achievements
Rank 1
Share this question
or