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

Undefined variable in kendo.web.js in leafDataCells functio

5 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam King
Top achievements
Rank 1
Adam King asked on 28 Apr 2015, 03:40 PM

We are getting an 'undefined is not an object' error in kendo.web.js in the built-in leafDatacells function.

I believe this is called when the grids are loading. It happens in several of our pages.

 

  a = $(a);
  var indexA = a.attr(indexAttr);

We recently updgraded our Kendo controls and are now experiencing a (somewhat random) value-undefined error.
The error occurs in the Kendo.Web.js file in function leafDataCells(container) {..}
In the second line of code above a is undefined so it throws an exception trying to use a.

When debugging it does not seem consistent so its hard to trace through the code.
However here are the details that popup when it happens:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Mon, 27 Apr 2015 20:57:02 UTC
Message: 'undefined' is null or not an object
Line: 1
Char: 667171
Code: 0
URI: http://

dev-sptd/bundles/kendo?v=oYZbo7NQSLuvHxwnjnakMZia9RBFZeO-xvVApBboXHo1

We do use grid sorting but is there an alternative to using leafDataCells function or a way to disable it and still sort, or is this a bug that needs to be worked on?

Thanks

5 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Apr 2015, 01:12 PM
Hi Adam,

We have not come across the described problem so far. In order to investigate it, we will need a runnable example, which reproduces the issue consistently. Would it be possible to create one, based on your real-world scenario?

Regards,
Rosen
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Eric
Top achievements
Rank 1
answered on 04 Jul 2015, 05:58 AM

I'm seeing what I expect is the same thing; it's unexpectedly hitting an undefined value within the leafDataCells method in kendo.all.js. (approx. line 54677)  Running version 2015.1.429.  The problem is intermittently occurring when the grid is being rendered/defined.  For us, it's users running IE8 which are encountering the issue most often.

I feel your pain about having a reproducible situation, unfortunately, I can't always get it to break on demand. 

To me, it feels like a race condition, because sometimes it's working, and sometimes it's not, and when it's not working, it seems to stay not working for a while, but then resolves itself after a few refreshes of the whole page.

 

0
Rosen
Telerik team
answered on 06 Jul 2015, 11:18 AM

Hello Eric,

Unfortunately, as I have said before we are not able to re-create the error locally using the provided information. Thus, a small sample which demonstrates the issue will be required.

The function itself works on the TH elements in the Grid's header which are queried just before the method call, therefore they 'should' exist during the processing. However, you should verify that you are not instantiating multiple Grid widget instances over the same HTML elements which possibly could cause such issue.

Regards,
Rosen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Caecilia
Top achievements
Rank 1
answered on 23 Oct 2016, 12:24 PM

We had this problem too... turns out to be an unrelieable array.prototype.sort() algorithm in the IE8 JavaScript runtime. Kendo.web.js reuses the a and b parameters in it's sort compareFunc - which IE8 does NOT like and "sometimes" returns an undefined.

See https://www.zachleat.com/web/array-sort/ for more information and a life demo.

I had to patch kendo.web.js to get rid of this "error". It is still existant in Kendo version 2016.3.914, btw.!

Quote from the Leatherman site: "Internet Explorer can’t make you do anything, it can only make you wish you hadn’t."

0
Rosen
Telerik team
answered on 24 Oct 2016, 07:47 AM

Hello Caecilia,

Thanks for sharing your findings. I have logged them in our issue tracker for further investigation. Also I have updated your telerik points as a token of gratitude for your involvement.

Regards,
Rosen
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Grid
Asked by
Adam King
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Eric
Top achievements
Rank 1
Caecilia
Top achievements
Rank 1
Share this question
or