I have asked this question here: Kendo: bind remote datesource to form
I am unable to post a comment as I do not have a sufficient reputation, so I do apologise for the duplicate post.
How do I bind the results from a ajax request to a form?
$.ajax({
url: "Read?messageID=" + "123456",
method: "get",
type: "application/json",
success: function (result) {
var dataSource = new kendo.data.DataSource({
data: result
});
console.log(result);
},
error: function (result) {
console.log(result);
}
});
I can see the data in the read but I do not know how to extract it and then bind it to a form. I have struggled to find documentation too.
This is the code I am using for my form input:
@Html.Label("message", "Note:", new { @class = "form-label" })
<input id="messages" class="form-control k-textbox" data-bind="value:message" />
I feel there is a missing piece in order to connect this together. I will keep searching and reading in the hopes of finding a solution but any help would be greatly appreciated.
Many thanks.
Per https://docs.telerik.com/kendo-ui/framework/mvvm/overview :
Bind the View to the View-Model. This is done by calling the kendo.bind method:
kendo.bind($("#view"), viewModel);
Your viewModel must be an observable, and your equivalent of
$("#view")must be a container that contains your entire form.