This is a migrated thread and some comments may be shown as answers.

KendoUI router cannot read property length of undefined

1 Answer 364 Views
SPA
This is a migrated thread and some comments may be shown as answers.
Jacques
Top achievements
Rank 1
Jacques asked on 25 Jul 2013, 07:49 PM
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 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);
            }
    }
    }),
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.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 29 Jul 2013, 08:18 AM
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. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
SPA
Asked by
Jacques
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or