filtering

Fired when the widget is about to filter the data source.

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

Event Data

e.sender kendo.ui.DropDownTree

The widget instance which fired the event.

e.filter Object

The filter descriptor that will be used to filter the data source.

Example - subscribe to the "filtering" event during initialization

<input id="dropdowntree"/>

<script>
$("#dropdowntree").kendoDropDownTree({
  dataSource: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }],
  filter: "startswith",
  filtering: function(e) {
      //get filter descriptor
      var filter = e.filter;

      // handle the event
  }
});
</script>

Example - subscribe to the "filtering" event after initialization

<input id="dropdowntree"/>

<script>
function dropdowntree_filtering(e) {
  //get filter descriptor
  var filter = e.filter;

  // handle the event
}
$("#dropdowntree").kendoDropDownTree({
  dataSource: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }],
  filter: "startswith"
});
var dropdowntree = $("#dropdowntree").data("kendoDropDownTree");
dropdowntree.bind("filtering", dropdowntree_filtering);
</script>

Example - prevent filtering event when filter value is empty

<input id="dropdowntree"/>

<script>
$("#dropdowntree").kendoDropDownTree({
  dataSource: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }],
  filter: "startswith",
  filtering: function(e) {
      var filter = e.filter;

      if (!filter.value) {
        //prevent filtering if the filter does not have value
        e.preventDefault();
      }
  }
});
</script>
In this article
Not finding the help you need? Improve this article