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

RadGrid and RadAjaxManager issue

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Barbara
Top achievements
Rank 1
Barbara asked on 15 Oct 2010, 07:04 PM
I have a web application that uses a master page and content pages. On several of the pages I am using the RadGrid Control and the RadAjaxManagerProxy control (the RadAjaxManager is on the master page). On one page in particular when the user clicks the form (html form tag) it triggers an event handler that causes a javascript error - "Microsoft JScript runtime error: Object doesn't support this property or method" - and calls the javascript function

Sys$WebForms$PageRequestManager$_matchesParentIDInList.


 

function

 

Sys$WebForms$PageRequestManager$_matchesParentIDInList(clientID, parentIDList) {

 

 

    for (var i = 0, l = parentIDList.length; i < l; i++) {

 

 

        if (clientID.startsWith(parentIDList[i] + "_")) {

 

 

            return true;

 

        }

    }

 

    return false;

 

}

 

On this page I have 3 RadGrids and if I remove the one with the following code evrything works fine.

 

<

 

telerik:RadGrid ID="gvExpenseAssignments" runat="server" AutoGenerateColumns="false" Height="570">

 

 

    <ClientSettings EnableRowHoverStyle="true">

 

 

        <Scrolling AllowScroll="true" ScrollHeight="550" UseStaticHeaders="true" />
    
</ClientSettings>

 

 

    <MasterTableView DataKeyNames="GL_Account_Template_Id" EditMode="InPlace" AllowMultiColumnSorting="false"

 

 

 

            TableLayout="Fixed" AllowNaturalSort="false" Width="99%">

 

 

 

        <Columns>

 

 

 

            <telerik:GridBoundColumn DataField="ItemsString" Visible="false" UniqueName="strHintItems"></telerik:GridBoundColumn>

 

 

 

            <telerik:GridBoundColumn DataField="GL_Account_Name" HeaderText="Account Name" ReadOnly="true" AllowSorting="true" HeaderStyle-Width="260"></telerik:GridBoundColumn>

 

 

 

            <telerik:GridButtonColumn Text="Hint" runat="server" CommandName="cmdHint" HeaderText="Account Items" ShowInEditForm="true" HeaderStyle-Width="65px" ItemStyle-Width="65px"></telerik:GridButtonColumn>

 

 

            <telerik:GridButtonColumn Text="Suggest" runat="server" CommandName="cmdSuggest" HeaderText="Mapping Assistant" ShowInEditForm="true" HeaderStyle-Width="65px" ItemStyle-Width="65px"></telerik:GridButtonColumn>

 

 

 

            <telerik:GridBoundColumn DataField="GL_Account_No" HeaderText="Linked Account No" UniqueName="lblAcctNo" ReadOnly="true" AllowSorting="true"></telerik:GridBoundColumn>

 

 

 

            <telerik:GridBoundColumn DataField="Cust_GL_Account_Name" HeaderText="Linked Account Name" UniqueName="lblAcctName" ReadOnly="true" AllowSorting="true"></telerik:GridBoundColumn>

 

 

 

        </Columns>

 

 

    </MasterTableView>

 

 

 

</telerik:RadGrid>

The whole aspx file is attached as an image file. I get the same behavior wether I data bind the grid or not. The issue that I have found is that clientID in the javascript function is a function and not a string so it contains no method startsWith. I have found a workaround that creates an anonomous function for startsWith -

 

Function.prototype.startsWith = function(){return false;};

 

 

but I would like to be able to find a mor permanent fix or what I am doing that is causing the error to begin with.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 21 Oct 2010, 09:07 AM
Hi Barbara,

I cannot reproduce what you are getting. Your grid setup seems fine. And the error you are getting is caused by the HTML dom element for a control not being found. The definition of the this function in the MS AJAX client library is:

function Sys$WebForms$PageRequestManager$_matchesParentIDInList(clientID, parentIDList) {
    for (var i = 0; i < parentIDList.length; i++) {
        if (clientID.startsWith(parentIDList[i] + "_")) {
            return true;
        }
    }
    return false;
}

This method is called at 2 places with:

this._matchesParentIDInList(element.id, this._asyncPostBackControlClientIDs)

and

this._matchesParentIDInList(element.id, this._postBackControlClientIDs)

As you can see, the first parameter is a DOM element whose ID is passed to the function. The error is cased by element being null or undefined, meaning no field id is defined for the element. I hope this helps.

Greetings,
Veli
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
Tags
Grid
Asked by
Barbara
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or