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

Kendo UI Grid Filter not working

2 Answers 304 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 16 Jul 2012, 10:40 PM
I am just starting with Kendo UI.  I have a .NET MVC Razor project that will include a Kendo Grid.  My page loads fine and looks good-the data is in the grid, but I have two issues:
(1) when I click the "filter" icon, nothing happens (no pop-up, nothing)
(2) when I run the page I get an error in visual studio inside the kendo.all.min.js file (Error: Microsoft JScript runtime error: Object doesn't suport this action.  Code highlighted reads "d.transport=new n.data.transports[a.type](c(h,{data:i}))"  Running in firebug gives this error: "n.data.transports[a.type] is not a constructor"

I am using a Model that is of type List<CustomViewModel>.  I have added the following scripts and css to my _Layout partial view:
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo.common.min.css")" rel="stylesheet" type="text/css" />  
    <link href="@Url.Content("~/Content/kendo.default.min.css")" rel="Stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo.all.min.js")" type="text/javascript"></script>

(I tried using "kendo.web.min" and "kendo.aspnetmvc.min" in the place of "kendo.all.min" and I get the same result, but the error is in kendo.web.min.js)


My page looks like this:

@model List<CustomViewModel>
...
@(Html.Kendo().Grid(Model)
    .Name("applicantGrid")
    .Columns(columns =>
        {
            columns.Bound(p => p.ApplicationID);
            columns.Bound(p => p.FirstName);
            columns.Bound(p => p.LastName);            
        })
    .Sortable()
    .Filterable()  
    .Pageable()        
)


My View Model looks like this:

    public class CustomViewModel
    {
        [ScaffoldColumn(false)]
        public Guid CustomViewModelID { get; set; }

        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Display(Name = "Last Name")]
        public string LastName { get; set; }
    }

2 Answers, 1 is accepted

Sort by
0
Dennis
Top achievements
Rank 1
answered on 17 Jul 2012, 04:10 PM
I add a Datasource property to my grid (along with some buttons and other things):

    .DataSource(dataSource => dataSource        
            .Server()
            .Model(model => model.Id(p => p.ID))
     )

However that didn't fix the problem.  I can sort, page, edit, etc.  The filter button just doesn't do anything.

I did notice that when I hover over the filter button, but cursor is an arrow.  In this example:http://demos.kendoui.com/web/grid/local-data.html, the cursor is a hand.  Does that give a clue as to what I'm missing?

Thanks!
0
Dennis
Top achievements
Rank 1
answered on 17 Jul 2012, 07:05 PM
I was using the wrong kendo.min.ui.  Once I updated that, everything worked.
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Dennis
Top achievements
Rank 1
Share this question
or