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

FilterMenuInit event not firing

1 Answer 867 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PrimePay
Top achievements
Rank 1
PrimePay asked on 17 Apr 2015, 03:30 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 17 Apr 2015, 03:58 PM

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.

 
Tags
Grid
Asked by
PrimePay
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or