I discovered in the end that I hadn't converted the JSON object into an observable when returned from an ajax call AND before binding it to the view.
$.ajax({
url: rootPath + "/profile/editprofile",
type: "GET",
data: "clientCode=xxx"
})
.done(function (result)
{
$("#viewEditorContent").html(result.html);
that.data = kendo.observable(result.clientViewModel);
that.editForm = $("#viewEditorContent form");
$.validator.unobtrusive.parse(that.editForm);
kendo.bind($("#viewEditorContent"), that);
})
in the done handler the result argument is a JSON object with 2 properties:
- html and
- clientViewModel
previously when I set that.data I did it without converting it to a kendo observable as in:
that.data = result.clientViewModel;
Which is why it was throwing the exception when trying to access a function called 'get'.