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

Strange IE behaviour

5 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lawrence
Top achievements
Rank 1
Lawrence asked on 21 Jun 2010, 12:47 PM
Hey guys

I have a strange issue that is driving me to distraction.  I have a simple grid as the below snippet demonstrates.

    Html.Telerik().Grid<Candidate>() 
        .Name("Grid") 
        .Columns(cols => 
                     { 
                         cols.Bound(i => i.Number) 
                             .Width(25) 
                             .Filterable(false) 
                             .Title("Candidate No") 
                             .HtmlAttributes(new {@class = "ResultsNumber"}) 
                             .HeaderHtmlAttributes(new {@class = "ResultsNumber"}); 
                     }) 
                    .DataBinding(db => db.Ajax().Select("CandidatesJson", "ResultsPreview")) 
                    .Sortable() 
                    .Pageable(pager => pager.PageSize(4)) 
                    .ClientEvents(events => events.OnDataBound("onDataLoaded")) 
                    .Render(); 

This works fine on Firefox however in Internet Explorer (v7 & 8) the first load of the grid seems to fail.  It leave the refresh spinner twisting in the wind, the pages list on has a single digit in it (instead of the 14 pages it should have!) and the "displaying" text simply states "0 - 0 of 0" (see attached screenie).  It also does not fire the OnDataBound event.  If you subsequently click the 'next button' arrow, it loads the second, and subsequent, pages with no difficulty; showing the page index and information fine.  However, it does screw up again when you click the first page.

IE does report an "unspecified error" in the middle of the jquery-1.4.2.min.js library (line #423).  I have the following ScriptRegistrar call in the page.  If I remove this the table appears to load fine (although with zero styling).

    <%= Html.Telerik().StyleSheetRegistrar()
                      .DefaultGroup(group => group
.                          .Add(
"telerik.common.css")
                           .Add(
"telerik.windows7.css")) %> 

If I remove this line, the

Anyone have any ideas?

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Jun 2010, 02:37 PM
Hello Lawrence,

Unfortunately we have not encountered this problem before. I hope it is possible for you to provide a sample project which shows the JavaScript error. You can use a public file sharing web site (dropbox.com, skydrive.live.com) in order to provide a link.

Regards,
Atanas Korchev
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
0
Lawrence
Top achievements
Rank 1
answered on 21 Jun 2010, 03:54 PM
Okay, I've found the issue.  The page I am having issue with also used the JQuery UI library.  This appears to be the issue.  If I remove the inclusion of JQuery-ui.js the grid works fine.

As requested I've uploaded a version of to the skydrive:  http://cid-eb4a69ca1233bcec.skydrive.live.com/redir.aspx?resid=EB4A69CA1233BCEC!142&Bpub=SDX.Docs&Bsrc=GetSharingLink

I appreciate your help. :-)
0
Atanas Korchev
Telerik team
answered on 21 Jun 2010, 04:15 PM
Hi Lawrence,

Try to manually include the jquery javascirpt file as well as the jquery UI like this:

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server"> 
<script type="text/javascript" src="<%= ResolveUrl("~/Scripts/2010.1.416/jquery-1.4.2.min.js")%>"></script>    <script type="text/javascript" src="<%= ResolveUrl("~/Javascripts/jquery.ui.all.js")%>"></script>


Regards,
Atanas Korchev
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
0
Lawrence
Top achievements
Rank 1
answered on 22 Jun 2010, 11:42 AM
Hey Atanas,

Tried that, and it didn't help.  I was able to get the grid appearing correctly if I moved the inclusion of the JQuery UI library above the call to Html.Telerik().ScriptRegistrar().  I got all excited until I realised that this caused my use of the JQuery UI dialog facility to fail with an "Object expected" error when calling $("#obj").dialog("open").  It only works if it's below the ScriptRegistrar() call.

Might it have something to do with the fact that I'm getting two inclusions of the JQuery-1.4.2.min.js file?  One is in the master page for the site (we don't use the grid everywhere) and the other comes in as a result of the ScriptRegistrar() call.  Can we stop the ScriptRegistrar() from including the JQuery library? 

I've tried to rip the results of the ScriptRegistrar() out and put these straight into the html however this stops the grid from working at all.


0
Atanas Korchev
Telerik team
answered on 22 Jun 2010, 05:25 PM
Hello Lawrence,

You can disable the automatic including of jquery like this:

Html.Telerik().ScriptRegistrar().jQuery(false);

Regards,
Atanas Korchev
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
Lawrence
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Lawrence
Top achievements
Rank 1
Share this question
or