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

error in telerik.grid.min.js

9 Answers 137 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.
Koen
Top achievements
Rank 1
Koen asked on 05 Oct 2010, 12:02 PM
Hi,

For a few weeks I'm using the Telerik MVC extensions, I have to say that I'm quite pleased with the toolset so far.

Yesterday however I ran into a problem with the grid, that I couldn't solve.
When I load the grid I get the javascript exception:
Microsoft JScript compilation error: Expected ';'

In the file telerik.grid.min.js line 1 col 77.

When I click continue the grid loads, but with every page load the error reappears.

In my master page, I'm loading the telerik javascript files with the following statement:
<%= Html.Telerik().ScriptRegistrar().jQuery(false).Globalization(true) %>
The jquery js file I load at the top of the master page in the header. (It needs to load earlier for a certain jquery control).

I don't have any clue what to do to resolve this problem. Do you have any clue what I could do?

Thanks for the help.

Best regards,

Koen


9 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Oct 2010, 07:26 AM
Hello Koen,

 We are not sure what can cause this problem. Could you please provide a sample project?

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
Koen
Top achievements
Rank 1
answered on 06 Oct 2010, 09:32 AM
Hi,

Thanks for the answer.

I made a sample project that gives the same error here. (on the home/Index).
In attachment the project & a screenshot of the error.

Best regards,

Koen
0
Atanas Korchev
Telerik team
answered on 07 Oct 2010, 07:20 AM
Hello Koen,

In which browser does the problem appear? I tried it locally in FireFox 3.6 and IE8  but I couldn't reproduce the JavaScript error. On a side note you can try upgrading to the service pack release.

All the best,
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
Koen
Top achievements
Rank 1
answered on 07 Oct 2010, 09:17 AM
Hi,

I have the problem both in Firefox 3.6 and IE8.
I've applied the service pack update, but the error still persists... :-(

In firebug the error is:
missing ; before statement
See also screenshot of firebug.

Is there anything that could be wrong with this piece of javascript?

Thanks for the help.

regards,

Koen
0
Atanas Korchev
Telerik team
answered on 07 Oct 2010, 11:19 AM
Hello Koen,

 I double checked the provided project but it runs fine on my end. Do I need to do anything after loading the page in the browser?

Greetings,
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
Terry Burns-Dyson
Top achievements
Rank 1
answered on 13 Oct 2010, 06:26 PM
Any idea on the solution for this? I'm getting the same issue, Chrome 6 and IE8 and 9 report the issue. I've tried with/without CDN, I've tried the latest version and the 2.825 release. 

Edit: Just to try and help out with this. I was working with ajax/server binding. I had been working on Template and Client template and was outputting a table. I was missing a span element and changed out <# #> for <#= #>. I can't provide the code. But when I matched up the Client and server Templates, the error wasn't happening. 
0
Terry Burns-Dyson
Top achievements
Rank 1
answered on 14 Oct 2010, 02:45 AM
Ok, I got past this and don't feel it's a problem with the tools. 

I was getting the error when I was rebinding the grid, because the string I was configuring as the ClientTemplate had tags that weren't being output correctly. I've not been a big user of ASP.NET so the whole <#= => stuff confused me, until I understood that I could evaluate code in there, 

ClientTemplate = new StringBuilder("<#= PossibleNullObject != null ? '")
                               .Append( "<table class=\"match-item\">")
                               .Append( "<tr><td><a href=\"Javascript:showSearch(' + recordId + ');\"><span class=\"showSearch\">' + PossibleNullObject.LocationCode + ' <span class=\"t-icon t-edit\">Edit</span></span></a></tr></td>")
                               .Append("<tr><td>' + (( PossibleNullObject.Company == null || PossibleNullObject.Company == '') ? PossibleNullObject.FirstName + ' ' + .LastName : PossibleNullObject.Company ) + '</td></tr>")
                               .Append("<tr><td>' + PossibleNullObject.POCode + '</td></tr>")
                               .Append("</table>' : 'No matching item' #>").ToString(),

Hopefully this helps the OP evaluate the code.
0
Koen
Top achievements
Rank 1
answered on 14 Oct 2010, 08:53 AM
Ah great it seems that this was my problem too this clienttemplate together with the Ajax databinding.
At first my grid was:

<% Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
    columns.Bound(m => m.ID).Width(50);
    columns.Bound(m => m.NEWSDATE).Format("{0:MM/dd/yyyy}").Width(120);
    columns.Bound(m => m.TEXT1).Width(200);
    columns.Bound(m => m.NEWSSTATUS).Format("{0}").Width(100);
    columns.Bound(m => m.EXPIRE).Format("{0:MM/dd/yyyy}").Width(120);
    columns.Bound(m => m.HOMESTATUS).Format("{0}").Width(100);
    columns.Bound(m => m.COUNTRY).Width(100);
    columns.Bound(m => m.BUNDLE).Width(100);
    columns.Add(m => m.ID)
    .Template(m =>
     {
       %>
           <%= Html.ActionLink("Edit", "Edit", new { id = m.ID })%>
       <%
    })
    .ClientTemplate("<a href='" + Url.Action("Edit", "Message") + "/<# ID #>Edit</a>")
    .Title(" ");
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Paging", "Grid"))
.Filterable()
.Sortable()
.Render();
%>

Next I've removed the Ajax databinding line:
               
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Paging", "Grid"))

And then it worked! great a postitive start of the day :-)
Thanks for the help!


0
scubakiz
Top achievements
Rank 1
answered on 26 Apr 2011, 03:31 AM
I'm not doing any Ajax and I'm getting:

Webpage error details


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; BO1IE8_v1;ENUS)
Timestamp: Tue, 26 Apr 2011 02:34:02 UTC

 Message: Expected ';'
Line: 1
Char: 9126
Code: 0
URI: http://localhost:9635/Scripts/2011.1.315/telerik.grid.min.js

My browser: IE8 64-bit

I noticed this comes up whenever I do anything inside the Toolbar on an MVC Grid.  Everywhere I have this code:

.ToolBar(toolBar => toolBar.Template(...

I get the error, but it seems to work fine.

No errors in Chrome or Firefox.
Tags
Grid
Asked by
Koen
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Koen
Top achievements
Rank 1
Terry Burns-Dyson
Top achievements
Rank 1
scubakiz
Top achievements
Rank 1
Share this question
or