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.MultiColumnComboBox
The widget instance which fired the event.
e.filter Object
The filter descriptor that will be used to filter the data source.
The data source filters the data items client-side unless the data source serverFiltering option is set to
true
.
Example - subscribe to the "filtering" event during initialization
<input id="multicolumncombobox" />
<script>
$("#multicolumncombobox").kendoMultiColumnComboBox({
dataSource: [
{ id: 1, name: "Apples" },
{ id: 2, name: "Oranges" }
],
columns: [
{ field: "name" },
{ field: "id" }
],
dataTextField: "name",
dataValueField: "id",
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="multicolumncombobox" />
<script>
function multicolumncombobox_filtering(e) {
//get filter descriptor
var filter = e.filter;
// handle the event
}
$("#multicolumncombobox").kendoMultiColumnComboBox({
dataSource: [
{ id: 1, name: "Apples" },
{ id: 2, name: "Oranges" }
],
columns: [
{ field: "name" },
{ field: "id" }
],
dataTextField: "name",
dataValueField: "id",
filter: "startswith"
});
var multicolumncombobox = $("#multicolumncombobox").data("kendoMultiColumnComboBox");
multicolumncombobox.bind("filtering", multicolumncombobox_filtering);
</script>
Example - prevent filtering event when filter value is empty
<input id="multicolumncombobox" />
<script>
$("#multicolumncombobox").kendoMultiColumnComboBox({
dataSource: [
{ id: 1, name: "Apples" },
{ id: 2, name: "Oranges" }
],
columns: [
{ field: "name" },
{ field: "id" }
],
dataTextField: "name",
dataValueField: "id",
filter: "startswith",
filtering: function(e) {
var filter = e.filter;
if (!filter.value) {
//prevent filtering if the filter does not value
e.preventDefault();
}
}
});
</script>