I try to navigate to a different route URL with the KendoUI router, but I get the infamous "Cannot read property length of undefined" error. This is a detail view ("/Person/Detail/8765") and if I do enter the URL manually in the browser, I get there without problem. I call the navigate on the schema callback of the Create page like this :
The data is defined and personId too when I reach the breackpoint. The error occur afterward.Please note that we are using require-jquery.js to manage our script loading and the stack trace shows that it passes in a few methods in it.
var createViewModel = kendo.observable({
representant: null,
candidatValidated: false,
updateRepresentantSource: new kendo.data.DataSource({
transport: {
read: {
url: "/Person/Create",
contentType: "application/json",
type: "POST"
},
parameterMap: function () {return kendo.stringify(createViewModel.person);}
},
schema: {
data: function (data) {
createViewModel.set("person", null);
router.router.navigate("/Person/Detail/" + data.personId, false);
}
}
}),