FilterMenuInit event not firing

2 posts, 0 answers
  1. PrimePay
    PrimePay avatar
    25 posts
    Member since:
    Feb 2015

    Posted 17 Apr 2015 Link to this post

    Hello,

    I have a grid with the filterMenuInit event set up to fire a custom function. However, the event is not firing when I open the filter menu. Here is some of the code for the grid:

     @(Html.Kendo().Grid(Model)
            .Name("Grid")
            .ColumnMenu()
            .Columns(columns =>
            {
                columns.Bound(m => m.Number)
                    .Title("Number")
                    .Width(140)
                    .Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(true).Template("NumberFilter")));
                columns.Bound(m => m.FirstName)
                    .Title("First Name")
                    .Width(140)
                    .Filterable(ftb => ftb.Cell(cell => cell.Delay(@serverSideDelay).ShowOperators(true)));
                columns.Bound(m => m.LastName)
                    .Title("Last Name")
                    .Width(140)
                    .Filterable(ftb => ftb.Cell(cell => cell.Delay(@serverSideDelay).ShowOperators(true));
            })
            .Pageable(pageable => pageable
                    .Refresh(true)
                    .ButtonCount(10))
            .ColumnMenu(menu =>
            {
                menu.Filterable(false);
                menu.Columns(false);
            })
            .Sortable(s => s
                .AllowUnsort(false)
                .SortMode(GridSortMode.SingleColumn))
            .Selectable()
            .EnableCustomBinding(true)
            .Events(e => e.FilterMenuInit("hideFilter"))
            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model => model.Id(m => m.ID))
                .Sort(s =>
                {
                    s.Add("LastName").Ascending();
                })
                .PageSize(10)
                .ServerOperation((bool)@ViewBag.IsServerSide)
                .Read(read => read.Action("ReadAction"))
                .Total((int)ViewBag.Count)
                .Events(events => events.Error("onKendoDataSourceError").RequestStart("checkFilter"))
            )
            .Events(e => e.Change("selectObject").DataBound("checkFilter"))
        )

     

    I'm using version 2014.3.1316. Can you please help with this? Thanks.

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2304 posts

    Posted 17 Apr 2015 Link to this post

    Hello PrimePay,

    The reason for this behavior is that the column menu is used in the current Grid. In this case you should bind to the columnMenuInit event instead.

    Regards,
    Dimiter Madjarov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top