New to Kendo UI for jQueryStart a free 30-day trial

Fired when the grid filter menu is initialized, when it is opened for the first time.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.container jQuery

The jQuery object representing filter menu form element.

e.field String

The field of the column for which the filter menu is initialized.

e.sender kendo.ui.Grid

The widget instance which fired the event.

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" }
  ],
  dataSource: [
    { name: "Jane Doe"},
    { name: "John Doe"}
  ],
  filterable: true,
  filterMenuInit: function(e) {
    if (e.field == "name") {
      var firstValueDropDown = e.container.find("select:eq(0)").data("kendoDropDownList");
      firstValueDropDown.value("contains");
      firstValueDropDown.trigger("change");

      var logicDropDown = e.container.find("select:eq(1)").data("kendoDropDownList");
      logicDropDown.value("or");
      logicDropDown.trigger("change");

      var secondValueDropDown = e.container.find("select:eq(2)").data("kendoDropDownList");
      secondValueDropDown.value("contains");
      secondValueDropDown.trigger("change");
    }
  }
});
</script>
<div id="grid"></div>
<script>
function grid_filterMenuInit(e) {
  if (e.field == "name") {
    var firstValueDropDown = e.container.find("select:eq(0)").data("kendoDropDownList");
    firstValueDropDown.value("contains");
    var logicDropDown = e.container.find("select:eq(1)").data("kendoDropDownList");
    logicDropDown.value("or");
    var secondValueDropDown = e.container.find("select:eq(2)").data("kendoDropDownList");
    secondValueDropDown.value("contains");
  }
}
$("#grid").kendoGrid({
  columns: [
    { field: "name" }
  ],
  dataSource: [
    { name: "Jane Doe"},
    { name: "John Doe"}
  ],
  filterable: true
});
var grid = $("#grid").data("kendoGrid");
grid.bind("filterMenuInit", grid_filterMenuInit);
</script>
Not finding the help you need?
Contact Support