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

Filter

methods

Gets or sets the filter configuration.

A list of the supported operators you can find in this filter operator configuration article.

Returns:Object

—The current filter configuration. Returns null if no filter criteria are currently applied. Returns undefined if the DataSource instance has not performed filtering so far.

<script>
var dataSource = new kendo.data.DataSource({
  data: [
    { name: "Jane Doe" },
    { name: "John Doe" }
  ]
});
dataSource.filter( { field: "name", operator: "startswith", value: "Jane" });
var view = dataSource.view();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(view.length);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(view[0].name); // displays "Jane Doe"
</script>
<script>
var dataSource = new kendo.data.DataSource({
  data: [
    { name: "Jane Doe" },
    { name: "John Doe" }
  ],
  filter: { field: "name", operator: "startswith", value: "Jane" }
});
var filter = dataSource.filter();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(filter.logic);  // displays "and"
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(filter.filters[0]); //displays '{field: "name", operator: "startswith", value: "Jane"}'
</script>
Not finding the help you need?
Contact Support