KendoUI router cannot read property length of undefined

2 posts, 0 answers
  1. Jacques
    Jacques avatar
    3 posts
    Member since:
    Sep 2012

    Posted 25 Jul 2013 Link to this post

    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 : 
    var createViewModel = kendo.observable({
        representant: null,
        candidatValidated: false,
        updateRepresentantSource: new{
            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);
    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.
  2. Petyo
    Petyo avatar
    2436 posts

    Posted 29 Jul 2013 Link to this post

    Hello Jacques,

     This is not a known issue. Can you isolate the problem (hopefully require.js should not cause it, so you should be able to remove it) in a runnable sample and post it? We will take a look. 

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top