I am using a kendo grid in my MVC application. Grid has two columns FirstName and LastName. Grid has a textbox where user can enter FirstName or LastName to search. I want to filter grid based on this criteria. Following is the code that i am currently using :
<script>
$(document).ready(function () {
$("#FirstNameFilter").keyup(function () {
var value = $("#FirstNameFilter").val();
grid = $("#grid").data("kendoGrid");
if (value) {
grid.dataSource.filter({ field: "FirstName", operator: "contains", value: value });
} else {
grid.dataSource.filter({});
}
});
});
</script>
Where FirstNameFilter is the name of textbox where user can enter FirstName or LastName. This code is currently working if user enters FirstName. I want to have "OR" condition in the filter so that it will also search for LastName.