I would like to bind my form to a kedno observable view model. I can get it to work with a hard coded value but not a DataSource. I have verified that the data source has one item in the view and I can fetch it. See code below. Any ideas? Thanks
//Hard coded first name binds to my form correctly
var viewModel = kendo.observable({
first_name: "John"
});
kendo.bind($("form"), viewModel);
//This doesn't bind correctly
var sharableDataSource = new kendo.data.DataSource({
transport: {
read: {
url: "myurl goes here" ,
dataType: "json"
}
}
});
var viewModel = kendo.observable({
datasource: sharableDataSource
});
kendo.bind($("form"), viewModel);
//HTML I am binding to
<li>First Name <span class="value" data-bind="text: first_name"> </span></</li>