transportObject
The configuration used to load and save the data items. A data source is remote or local based on the way it retrieves data items.
Remote data sources load and save data items from and to a remote end-point (also known as remote service or server). The transport
option describes the remote service configuration - URL, HTTP verb, HTTP headers, and others. The transport
option can also be used to implement custom data loading and saving.
Local data sources are bound to a JavaScript array via the data
option.
Example - specify the remote service configuration
<script>
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 products = dataSource.data();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(products[0].ProductName); // displays "Chai"
});
</script>
In this article