setDataSource
Sets the data source of the widget. The new dataSource will override the configurations and data of the old one.
Parameters
dataSource kendo.data.DataSource
The data source to which the widget should be bound.
Example - set the data source
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ name: "Jane Doe", age: 30 }
]
});
var dataSource = new kendo.data.DataSource({
data: [
{ name: "John Doe", age: 33 }
]
});
var grid = $("#grid").data("kendoGrid");
grid.setDataSource(dataSource);
</script>