search function using mvccontrinb
search function using mvccontrinb
kmatth007
Posts: 1Questions: 0Answers: 0
I am trying to implement a searchable grid in a MVC application using MVCContrib and jquery datatable.
When I run the application I get a "SCRIPT5007: Unable to get value of the property 'className': object is null or undefined" error. It appears to have a problem with the .Attributes(id => "example") code and the end of the grid. If I remove this line it loads fine but then i don't have the search box for the grid. Any help would be greatly appreciated. Thanks!
@{
Entities db = new Entities();
IEnumerable User = db.User.ToList();
}
@{
$(document).ready(function () {
$('#example').dataTable({
"iDisplayLength": 25,
"aaSorting": [[3, "asc"]],
"aoColumns": [{ "bSortable": false }, null,
null, null, null, { "bSortable": false}]
});
});
@Html.Grid(User).Columns(column =>
{
column.For(c => c.FirstName);
column.For(c => c.LastName);
column.For(c => c.Email);
//column.For(c => Html.ActionLink("Send e-mail", "Send", new { id = c.UserGUID })).Encode(false);
}).Attributes(id => "example")
When I run the application I get a "SCRIPT5007: Unable to get value of the property 'className': object is null or undefined" error. It appears to have a problem with the .Attributes(id => "example") code and the end of the grid. If I remove this line it loads fine but then i don't have the search box for the grid. Any help would be greatly appreciated. Thanks!
@{
Entities db = new Entities();
IEnumerable User = db.User.ToList();
}
@{
$(document).ready(function () {
$('#example').dataTable({
"iDisplayLength": 25,
"aaSorting": [[3, "asc"]],
"aoColumns": [{ "bSortable": false }, null,
null, null, null, { "bSortable": false}]
});
});
@Html.Grid(User).Columns(column =>
{
column.For(c => c.FirstName);
column.For(c => c.LastName);
column.For(c => c.Email);
//column.For(c => Html.ActionLink("Send e-mail", "Send", new { id = c.UserGUID })).Encode(false);
}).Attributes(id => "example")
This discussion has been closed.
Replies
Allan