I've bound data sources to grids and dropdownlist widgets but I haven't seen many examples or binding the data in a datasource to simple multiple labels or textboxes on a page load (in MVVM preferably). I can bind it to a simple variable defined in the observable objects but how can I bind it to a datasource value like an array of objects?
<script id="index" type="text/x-kendo-template">
<span data-bind="text: someTextValue"></span>
<span data-bind="text: someTextValue2"></span>
</script>
var viewModelIndex = kendo.observable({
someTextValue: '12345',
someTextValue2: '12345',
fruits: new kendo.data.DataSource({
data: [
{ id: 1, name: "Apples" },
{ id: 2, name: "Oranges" },
{ id: 3, name: "Bananas" }
],
schema: {
model: {
fields: {
id: { type: "number" },
name: { type: "string" }
}
}
}
}),
});
.