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

Microsoft JScript runtime error with Accordion ajax

0 Answers 69 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
ROLANDO
Top achievements
Rank 1
ROLANDO asked on 04 Aug 2011, 03:42 PM
Hi, I have the following problem, I have an Ajax Accordion and I have a js callAccordionExtender.js in the master page I have RadScriptManager and sends me the nexterror: Microsoft JScript runtime error: Object does not support this property or method, couldhelp?

pag. aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPages/master1.master"
    AutoEventWireup="false" CodeFile="page.aspx.vb" Inherits="test_page" Title="page" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphJavaScript" runat="Server">
    <script src="../Scripts/AccordionExtender.js" type="text/javascript"></script>
    <script type="text/javascript">
        var accordionAllExpanded = false;
        var launch = false;
        function pageLoad() {
            if (launch) {
                $find('<%=modalManualFee.ClientID %>').show();
            }
            setAccordionExtension();
        }
        function hideModal() {
            $find('<%=modalManualFee.ClientID %>').hide();
        }
        function launchModal() {
            launch = true;
        }
        function HideButtonOnClick(button) {
            if (typeof Page_ClientValidate != 'undefined') {
                Page_ClientValidate();
                if (Page_IsValid) button.style.display = 'none';
            }
            else {
                button.style.display = 'none';
            }
        }
        function accordionExpandAll(button) {
            $find('<%=accLocations.ClientID %>_AccordionExtender')._expandAllPanes(!accordionAllExpanded);
            if (!accordionAllExpanded) {
                button.innerText = "Collapse All";
                button.className = "button left icon_collapse"
            }
            else {
                button.innerText = "Expand All";
                button.className = "button left icon_expand"
            }
            accordionAllExpanded = !accordionAllExpanded;
        }
    </script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphContentMain" runat="Server">
 <telerik:RadAjaxManager ID="AjaxManager" runat="server">
        <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="accLocations">
                <UpdatedControls>
 <telerik:AjaxUpdatedControl ControlID="pnlCart" LoadingPanelID="RadAjaxLoadingPanel" />
 </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
<ajaxToolkit:Accordion ID="accLocations" EnableViewState="true" runat="server">
                <HeaderTemplate>
.........
 </ajaxToolkit:Accordion>
</asp:Content>
file js

function setAccordionExtension() {
    Sys.Application.add_load(Sys.Extended.UI.AccordionBehavior.prototype._expandAllPanes =
                function expandAllPanes(openOrClose) {
                    this._changeSelectedIndex(-1, true);
                    for (var i = 0; i < this._panes.length; i++) {
                        // Get the animation for each pane (creating it on demand if it doesn't
                        // already exist)
                        var pane = this._panes[i];
                        var animation = this._getAnimation(pane);
                        animation._opening = openOrClose;
                        var open = null;
                        var close = null;


                        // Stop any animations that are still playing (i.e. that haven't finished
                        // opening or closing from changing previous panes)
                        if (animation.get_isPlaying()) {
                            animation.stop();
                        }


                        // Get the pane ready to be animated by setting
                        this._startPaneChange(pane, animation._opening);


                        // Setup the fade effect if we are using it
                        if (this._fadeTransitions) {
                            animation._fade.set_effect(animation._opening ? Sys.Extended.UI.Animation.FadeEffect.FadeIn :
                                Sys.Extended.UI.Animation.FadeEffect.FadeOut);
                        }


                        // Set the length animation and the target
                        if (this._autoSize === Sys.Extended.UI.AutoSize.Fill) {
                            animation.set_target(pane.content._original);
                            animation._length.set_startValue(CommonToolkitScripts.getContentSize(pane.content._original).height);
                            animation._length.set_endValue(animation._opening ? this._getRemainingHeight(true) : 0);
                        } else {
                            animation.set_target(pane.content);
                            animation._length.set_startValue(pane.content.offsetHeight);
                            animation._length.set_endValue(animation._opening ? this._getRemainingHeight(false) : 0);
                        }


                        //Open or Close all the pannels
                        if (openOrClose) {
                            animation._opening = true;
                            open = animation;


                            if (open) {
                                open.play();
                            }
                        }
                        else {
                            animation._opening = false;
                            close = animation;
                            if (close) {
                                close.play();
                            }
                        }
                    }
                }
                );
}

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
ROLANDO
Top achievements
Rank 1
Share this question
or