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
thank you for help, i'll check your suggested actions; I think the issue involve jQuery...
Thank you
Roberto
I am experiencing the same error.
Did you find a solution to this?
Best regards,
Mark Berghaan
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
<% 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
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
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.
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
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.
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
Now to get the OK for the upgrade ;)
Thanks for your help.
Mark Berghaan