Javascript runtime error: “object doesn't support property or method” in Internet Explorer

前端 未结 2 1272
梦谈多话
梦谈多话 2020-12-20 10:39

I\'m using kendo grids and they work fine for the CRUD operations. Now, I wanted to add filtering by adding the .Filterable() option to the grid\'s specificatio

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 11:03

    Make sure you have Jquery-1.8.1.min.js or higher version of jquery in your page.Because addBack is added in 1.8.

    Try like this,

     @(Html.Kendo().Grid()
        .Name("datagrid_Concessions")
        .Columns(columns =>
        {
            columns.Bound(c => c.Code).Title("Code");
            columns.Bound(c => c.Description).Title("Description");
            columns.Bound(c => c.TrafficOpeningDate).Title("Traffic Opening Date");
            columns.Bound(c => c.CreationDate).Title("Creation Date");
        })
        .HtmlAttributes(new { style = "height: 534px;" })
        .Filterable() // here's the filterable option
        .Selectable()
        .Events(e => e.Change("onChange"))
        .Pageable(pageable => pageable
            .Refresh(true))
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(15)
            .Model(model =>     <--- Add this
             {
               model.Id(m => m.Id);
               model.Field(m => m.Code);
               model.Field(m => m.Description);
             })
            .Read(read => read.Action("GetConcessions", "MasterData"))
        )
        )
    

    See this DEMO : http://jsbin.com/emuqazEz/4/edit

提交回复
热议问题