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

Filtering and Javascript Issue

11 Answers 108 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.
Roberto
Top achievements
Rank 1
Roberto asked on 12 Nov 2010, 02:53 PM
Dear All,

I am dealing with a particular issue when using mvc grid (Q2 release) . In particular when I try to apply a filter on a grid I receive the Message (JavaScritp Error):

Microsoft JScript runtime error: '2' is null or not an object

Does anyone encountered this problem?

Thanks in Advance

Roberto

11 Answers, 1 is accepted

Sort by
0
roger
Top achievements
Rank 1
answered on 12 Nov 2010, 06:08 PM
Could you trace the error in the VS Debugger and / or FireBug and take a look in which file it occurs? (telerik.x.js, jquery.x.js etc etc). Then check which variable is null. If you have any jquery plugins added, try to remove them (for debugging purpose) or load them after the telerik scripts. Also make sure you have indeed included all the necessary script files.
0
Roberto
Top achievements
Rank 1
answered on 12 Nov 2010, 06:58 PM
Dear Roger

thank you for help, i'll check your suggested actions; I think the issue involve jQuery...

Thank you

Roberto
0
M.
Top achievements
Rank 1
answered on 16 Dec 2010, 03:19 PM
Hello,

I am experiencing the same error.
Did you find a solution to this?

Best regards,

Mark Berghaan
0
Atanas Korchev
Telerik team
answered on 16 Dec 2010, 03:58 PM
Hello M.,

 We need a sample project showing how to reproduce this JavaScript error. You can attach it to this forum thread or submit a support ticket.

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
M.
Top achievements
Rank 1
answered on 12 Jan 2011, 07:54 AM
I am using an IList coming to the view with my model to populate the grid as such:
<% Html.Telerik().Grid<DBCOnderhoud.Vis.ServiceProxy.TableName>(Model.TableNames)
           .Name("TableNameGrid")
           .Columns(columns =>
           {
               columns.Bound(o => o.TableNameId).Hidden(true);
               columns.Bound(o => o.Name).Title("Naam").Width("20%").HtmlAttributes(new { style = "text-align:left" });
               columns.Bound(o => o.Reason).Title("Doel").Width("20%").HtmlAttributes(new { style = "text-align:left" });
               columns.Bound(o => o.Description).Title("Omschrijving").Width("20%").HtmlAttributes(new { style = "text-align:left" });
               columns.Bound(o => o.TableTypeId.TableTypeName).Title("Soort").Width("20%").HtmlAttributes(new { style = "text-align:left" });                      
           })
                           .DataKeys(keys => keys.Add(c => c.TableNameId))                     
                           .Scrollable(c => c.Height("450px"))
                           .Selectable()
                           .Sortable()
                           .Footer(false)
                           .Filterable()
                            .ClientEvents(events => events
                            .OnRowSelect("onRowSelect")
                            .OnLoad("onGridLoad")
                            )                            
                            .Render();                                
                       %>

All my controller does is fill this IList and put it in the model
I think this is almost as basic as it gets.
The same javascript error appears directly when pressing on either filter or clear filter.
It then shows this highlighted in VS 2010:

g=k(g,m[2])

Its inside telerik.common.min.js 

Thanks in advance,

Mark Berghaan
BetaBit



0
Atanas Korchev
Telerik team
answered on 12 Jan 2011, 09:11 AM
Hi,

 Unfortunately the source code does not indicate the reason for the JavaScript error. It may be due to missing JavaScript file. If you are loading the grid in a partial view make sure that all required JavaScript files are included.

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
M.
Top achievements
Rank 1
answered on 12 Jan 2011, 10:30 AM
We have this grid in a view that is opened directly.
A detail to this may be that we have 1 form defined in the master page which we use for all views.
My included files showing at runtime are:

jquery-1.4.2.min.js
telerik.common.min.js
telerik.common.min.js
telerik.panelbar.min.js
telerik.textbox.min.js
telerik.grid.min.js
telerik.grid.filtering.min.js

sorting the grid works fine, just filtering produces the error.
The same error is produced regardless off which column I try to filter.

0
Atanas Korchev
Telerik team
answered on 12 Jan 2011, 10:42 AM
Hi,

 Could you provide a sample project which we can run? This is not a known issue and we need to reproduce it first. You could attach the project to this forum thread.

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
M.
Top achievements
Rank 1
answered on 12 Jan 2011, 11:46 AM
My project is rather large and it would take a long time to rip it so that it is clean enough to send.

I have put a debugger at the error.
Version used is 2010.2.825
These are the locals:
j = /(S(usg4bw1l22pjjdi2npzyegoz))/TableNameSelection/TableNameSelection?TableNameGrid-orderBy={1}&TableNameGrid-filter={3}

h = /\{0(:([^\}]+))?\}/gm

g = 1
f = 4
e = 0
filtering Methods shows : initialize(g)

 var m = h.exec(j);  returns a null
Therefor m[2] cannot be.

Maybe this helps.
0
Atanas Korchev
Telerik team
answered on 12 Jan 2011, 12:22 PM
Hello,

Perhaps this is due some bug which we have already fixed. You can try upgrading to a more recent version. The current official one is 2010.3.1110 and there is a more recent in the internal builds section of our web site.

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
M.
Top achievements
Rank 1
answered on 12 Jan 2011, 12:57 PM
Thanks updating to the new official version you suggested does fix this problem.
Now to get the OK for the upgrade ;)

Thanks for your help.

Mark Berghaan
Tags
Grid
Asked by
Roberto
Top achievements
Rank 1
Answers by
roger
Top achievements
Rank 1
Roberto
Top achievements
Rank 1
M.
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or