dataSourcekendo.data.DataSource
The DataSource of the widget. Configured via the dataSource option.
Changes of the DataSource will be reflected in the widget.
Important: Assigning a new DataSource would have no effect. Use the setDataSource method instead.
Example
<div id="listview"></div>
<script>
var dataSource = new kendo.data.DataSource({
data: [
{ name: "Item 1" },
{ name: "Item 2" },
{ name: "Item 3" }
]
});
var listview = $("#listview").kendoListView({
dataSource: dataSource,
template: "<div class='k-listview-item'>#: name #</div>"
}).data("kendoListView");
// Access the dataSource
var currentDataSource = listview.dataSource;
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(currentDataSource.data()); // logs the data array
</script>
In this article