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

[Solved] Many many script errors

7 Answers 189 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Daron
Top achievements
Rank 1
Daron asked on 16 May 2008, 08:34 AM
I have been developing my site to target IE, since that's what 95% of end users will be using. However the site needs to be as compatible as possible with Firefox and Safari as well. Here's where my problems begin.

I'm getting script errors (that have knock-effects to the point where ajax stops working) in several controls including RadAjaxManager, RadTreeView and RadPanelBar.

Here's an example error as reported by Safari (on RadTreeView.NodeClick) event:


I have no idea what the code at line 9025 does and no intention of attempting to debug it.

I get this error on just about every nodeclick. It doesn't seem to cause problems in IE (doesn't throw script errors either), but in Safari and FF it's fatal because ajax seems to stop working after a couple of these errors.

Cheers,
Daron

7 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 16 May 2008, 08:45 AM
Hello Daron,

Unfortunately we are not aware of such kind of errors in Safari. Can you please share which version of Safari is that?

I just tried a latest release demo on Safari 3.1.1 but don't get any errors:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/TreeView/Examples/Functionality/Whatsnew/DefaultCS.aspx

Do you get those with the ASP:ScriptManager on the page instead?

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daron
Top achievements
Rank 1
answered on 16 May 2008, 09:19 AM
Hi Konstantin,
I'm on Safari 3.1 Win32 (upgrading to 3.1.1 now to see if it makes a difference).

I am getting some script errors on the Telerik demo pages (although none as serious as the ones I'm suffering locally). Do you have any online demos of a RadGrid row-select populating something on rowclick via ajax? eg, a list of cars in a RadGrid and when you select a row it displays more details in a panel? This is my setup and I want to see if the Telerik demo throws the same errors.

Cheers,
Daron
0
Daron
Top achievements
Rank 1
answered on 16 May 2008, 09:36 AM
OK,
I've narrowed it down to which Telerik control is causing the problem and it's the RadGrid.

The reason I thought it could have been the treeview is because when the user clicks a treenode, the corresponding radgrid row is programatically clicked.
 
The problem is with the 'RowSelected' event, specifically finding a reference to RadAjaxManager. Please see code:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
        // <![CDATA[    
        function gridDocumentView_RowSelected(sender, eventArgs)
        {
            $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(sender.UniqueID + "|" + eventArgs.get_itemIndexHierarchical());
        }
        // ]]> 
    </script> 
    </telerik:RadCodeBlock>   
      
    <telerik:RadGrid id="gridDocumentView" runat="server" width="100%" height="100%"   
        borderwidth="0px" gridlines="None" 
        autogeneratecolumns="False" 
        DataMember="Documents" OnItemDataBound="gridDocumentView_ItemDataBound" OnItemCommand="gridDocumentView_ItemCommand">  
        <ClientSettings reordercolumnsonclient="False" allowdragtogroup="False" allowcolumnsreorder="False">  
            <selecting allowrowselect="True"></selecting> 
            <scrolling allowscroll="True" usestaticheaders="True"></scrolling> 
            <resizing allowrowresize="False" enablerealtimeresize="True" resizegridoncolumnresize="True" 
                allowcolumnresize="False"></resizing> 
            <ClientEvents OnRowSelected="gridDocumentView_RowSelected"></ClientEvents> 
        </ClientSettings> 
        <mastertableview datamember="Documents" allowmulticolumnsorting="False" width="100%">  
            <rowindicatorcolumn uniquename="RowIndicator" Visible="false">  
                <headerstyle width="10px"></headerstyle> 
                <itemstyle width="10px"></itemstyle> 
            </rowindicatorcolumn> 
            <norecordstemplate> 
                <div class="gridNoResults">  
                    <asp:label runat="server" id="Label1">No documents in current folder</asp:label> 
                    <br /> 
                </div> 
            </norecordstemplate> 
 
        </mastertableview> 
    </telerik:RadGrid> 

I can click one row, and the details panel beneath is populated (via ajax). However subsequent row clicks do nothing and in fact throw script errors because $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>") is returning 'null'.

My RadGrid is on a webform that belongs to a masterpage.

What am I doing wrong? And why would this work OK in IE?
I have now upgraded Safari to 3.1.1 and getting the same problem.

Thanks
Daron
0
Daron
Top achievements
Rank 1
answered on 16 May 2008, 10:52 AM

I'm pulling my hair out here!

I have partially gotten around the problem by using the ajax capabilities of the RadGrid itself - rather than calling a client-side function. So I have set EnablePostBackOnRowClick="true" and then I'm processing the OnItemCommand event (as per http://www.telerik.com/demos/aspnet/Grid/Examples/Client/PostbackOnClientRowClick/DefaultCS.aspx). The problem now (there's always something) is that the loading panel only appears the first time, and also the format of the RadGrid messes up (icons disappear, columns move out of alignment, etc..)

The RadAjaxManager is setup to update my Panel when a RadGrid row is clicked.

I desperately need help out of this dilemna as my deadline is almost upon me.

Cheers

0
Konstantin Petkov
Telerik team
answered on 16 May 2008, 01:27 PM
Hi Daron,

May we see the AJAX settings please? Is the Grid set as updated control when it initiates AJAX through EnablePostbackOnRowClick functionality?

There is a similar demo here for example:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/SelectedValue/DefaultCS.aspx

The second grid is updated based on the SelectedValue from the first Grid.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daron
Top achievements
Rank 1
answered on 16 May 2008, 04:11 PM
hmmm this is getting quite annoying. I have managed to make this work by using the ajax functionality of the RadGrid itself (and autopostback) - but the icon columns (implementing ITemplate) are not persisted across callbacks - I don't want to have to repopulate the grid each time a row is clicked as this will cause too much stress on the server. Also, the page is already quite heavy so I don't want to have to add the grid's content into the viewstate.

I don't understand why the client-side row select is causing so much grief - something you need to look into I think (works in IE but not other browsers). Actually, it's more to do with the AjaxManager being "forgotten" between callbacks - the next time you attempt to invoke it it returns 'null'.

You requested my ajaxsettings - there's nothing much interesting to show. I have the RadGrid as the "initiating" control and my details panel as the "to update" control.

I wish I had looked for this sooner as I use the client-side row select of RadGrid quite extensively throughout my site - this (in essence) renders my site IE-compatible only .... something tells me the client will not be happy.
0
Konstantin Petkov
Telerik team
answered on 16 May 2008, 04:16 PM
Hi Daron,

I would definitely suggest you to add Grid -> Grid AJAX setting as well. Note that if you trigger an AJAX request from the client (ajaxRequest/ajaxRequestWithTarget methods) you need the AJAX Manager set as initiator and the respective controls which you update added as updated controls.

Let us know if this helps or if you find anything else which is related to the problem.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Daron
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Daron
Top achievements
Rank 1
Share this question
or