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

Groupable Uncaught TypeError: Cannot read property 'length' of undefined kendo.all.js

14 Answers 3935 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jwize
Top achievements
Rank 1
jwize asked on 26 Aug 2013, 08:05 AM
* Kendo UI Complete v2013.2.716 

When I try to use the grouping functionality of the grid as soon as I drag a column. The waiting gif shows and hangs. Meanwhile, in the console I see the following error : Uncaught TypeError: Cannot read property 'length' of undefined kendo.all.js. 

I have noticed this in other versions of the kendo grid as well. In the past I was able to get it to work in the past by downgrading my jquery to 1.7.1. This is unacceptable since the script is supposed to be compatible with 1.9.1 and downgrading causes compatibility issues with other scripts that I am using from other frameworks. This issue has been left un-addressed for way too long. 

Please provide a patch for this bug. 

14 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Aug 2013, 01:28 PM
Hello,

Please check the below link to see dependency on Jquery.js

http://docs.kendoui.com/getting-started/javascript-dependencies#jquery-version

Thanks,
Jayesh Goyani
0
T. Tsonev
Telerik team
answered on 28 Aug 2013, 07:28 AM
Hi,

The online demos, including Column Reordering, are using jQuery 1.9.1
They function properly and I doubt that the error you see has anything to do with the jQuery version.

Please, check that you're including the scripts in the correct order and that you're not loading jQuery more than once.
We'll need to take a look at the actual page in order to provide more specific advice.

Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
jwize
Top achievements
Rank 1
answered on 28 Aug 2013, 06:43 PM
Your post points out an example that doesn't seem related but my later post works for me.
0
jwize
Top achievements
Rank 1
answered on 30 Aug 2013, 08:33 AM
Seems I have to set Ajax().ServerOperation(false) and things work.
0
T. Tsonev
Telerik team
answered on 30 Aug 2013, 08:33 AM
Hi,

Sorry about misreading your question. I tried reproducing the problem, this time with grouping enabled, but again with no success.
This is the complete page I used for testing:

<!DOCTYPE html>
<html>
<head>
  <link href="http://cdn.kendostatic.com/2013.2.716/styles/kendo.common.min.css" rel="stylesheet" />
  <link href="http://cdn.kendostatic.com/2013.2.716/styles/kendo.default.min.css" rel="stylesheet" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://cdn.kendostatic.com/2013.2.716/js/kendo.all.min.js"></script>
</head>
<body>
  <div id="grid" />
  <script>
    $("#grid").kendoGrid({
      dataSource: {
        transport: {
          read: {
            url: "http://demos.kendoui.com/service/Products",
            dataType: "jsonp"
          }
        },
        pageSize: 5,
        group: {
          field: "UnitsInStock",
          dir: "asc"
        }
      },
      groupable: true,
      columns: [ 
        {
          field: "ProductName",
          title: "Product Name"
        },
        {
          field: "UnitPrice",
          title: "Unit Price",
          format: "{0:c}"
        },
        {
          field: "UnitsInStock",
          title: "Units In Stock"
        } 
      ] 
    }); 
  </script>
</body>
</html> 


Do you mind sharing the JSBin you're using for testing? Perhaps we're configuring the Grid differently.Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 2
Veteran
answered on 20 Feb 2014, 03:39 PM
I just want to indicate that I had the exact same issue as Jaime.  I'm currently using 2013.3.1324.  I receive the same JavaScript error unless I set my MVC wrapper to use .Ajax().ServerOperation(false).

Thanks to Jaime for the workaround, but I'm not sure this constitutes a true fix.

Telerik, do you have any thoughts?
0
Nikolay Rusev
Telerik team
answered on 24 Feb 2014, 10:23 AM
Hello Kyle,

We are not able to replicate this behavior. Can you please extract a runnable sample where this issue manifests itself so we can debug it locally?

Regards,
Nikolay Rusev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 2
Veteran
answered on 24 Feb 2014, 01:43 PM
Since it's an MVC app, I've attached a quick demo.  Look at the Home/About view.
1
Nikolay Rusev
Telerik team
answered on 24 Feb 2014, 03:24 PM
Hello Kyle,

You are missing the [DataSourceRequest] attribute in the `GridRead` action method.
[HttpPost]
public ActionResult GridRead([DataSourceRequest]DataSourceRequest request)
{
 return Json(CreateData().ToDataSourceResult(request));
}


Regards,
Nikolay Rusev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 2
Veteran
answered on 24 Feb 2014, 03:58 PM
You are absolutely right.  Nice find.

As always, you guys rock.

Thanks again.
0
Mako
Top achievements
Rank 1
answered on 06 Nov 2014, 04:28 PM
We are getting this error as well. 

Uncaught TypeError: Cannot read property 'length' of undefined
                     --kendo.web.min.js:10

Adding .ServerOperation(false) to or dataSource description does make the error go away, but this is not an acceptable fix for us because some of our data sets are very large; paging and sorting must be done server-side. 
Is there any real fix for this error? is one likely in the future? 

We're using kendo 2014.2.716 and Chrome. 
0
Nikolay Rusev
Telerik team
answered on 10 Nov 2014, 08:20 AM
Hello Mako,

We are not sure about the scenario you have. Can you provide us with an example for this behavior?

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gauravi
Top achievements
Rank 1
answered on 24 Sep 2015, 05:22 AM

I have same issue in my kendo grid. I have 12000 records. if i am putting .ServerOperation(false) my records are not binding to grid. and if I am putting .ServerOperation(true) my records are coming but filtering , grouping is not working.

 

Thank You

Gauravi

0
Nikolay Rusev
Telerik team
answered on 28 Sep 2015, 06:17 AM

Hello Gauravi,

 

The question you've posted is not directly related to the original forum topic. Thus I suggest you to open a new one with your question.

 

It will be also helpful if you provide us with runnable example where the behavior can be observed. I see that you are using MVC wrappers and in case of that amount of items the request might fail ( you can inspect the Network tab of your browser). Here is possible reason and solution for it - Error during serialization or deserialization using the JSON JavaScriptSerializer

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
jwize
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
T. Tsonev
Telerik team
jwize
Top achievements
Rank 1
Kyle
Top achievements
Rank 2
Veteran
Nikolay Rusev
Telerik team
Mako
Top achievements
Rank 1
Gauravi
Top achievements
Rank 1
Share this question
or