kendo datasource read code example

Example 1: kendo datasource get

var dataSource = new kendo.data.DataSource({
  transport: {
    read:  {
      url: "https://demos.telerik.com/kendo-ui/service/products",
      dataType: "jsonp" // "jsonp" is required for cross-domain requests; use "json" for same-domain requests
    }
  }
});
dataSource.fetch(function(){
  var data = dataSource.data();
  console.log(data.length);  // displays "77"
  console.log(data[0].ProductName); // displays "Chai"
});

Example 2: add data to kendo grid datasource.read in js

var optionalData = { foo: 42, bar: "baz" };

dataSource.read(optionalData);