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

Query

methods

Executes the specified query over the data items. Makes an HTTP request if bound to a remote service.

This method is useful when you need to modify several parameters of the data request at the same time (e.g. filtering and sorting). If you execute filter() and then sort(), the DataSource will make two separate requests. With query(), it will make one request.

This method will remove the current sort, filter, group, aggregates descriptors and paging information, if such are not provided as arguments.

Returns:Promise

—A promise that will be resolved when the data has been loaded or rejected if an HTTP error occurs.

<script>
var dataSource = new kendo.data.DataSource({
  transport: {
    read: {
        url: "https://demos.telerik.com/service/v2/core/products",
        dataType: "json"
    }
  },
  change: function(e) {
    var view = this.view();
    /* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(view)
    console.log(view[0].ProductName); // displays "Manjimup Dried Apples"
  }
});
// Filter only results with ProductID greather than 30, sort by "ProductName" and get the second page with page size set to 20. 
dataSource.query({
  sort: { field: "ProductName", dir: "desc" },
  filter: { field: "ProductID", operator: "gt", value: 30 },
  page: 2,
  pageSize: 20
});
</script>
<script>
var dataSource = new kendo.data.DataSource({
  transport: {
    read: {
        url: "https://demos.telerik.com/service/v2/core/products"
    }
  }
});
// sort by "ProductName" and get the third page with page size set to 20
dataSource.query({
  sort: { field: "ProductName", dir: "desc" },
  page: 3,
  pageSize: 20
}).then(function(e) {
    var view = dataSource.view();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(view[0].ProductName); // displays "Manjimup Dried Apples"
  });
</script>
Not finding the help you need?
Contact Support