Undefined variable in kendo.web.js in leafDataCells functio

6 posts, 0 answers
  1. Adam King
    Adam King avatar
    32 posts
    Member since:
    May 2010

    Posted 28 Apr 2015 Link to this post

    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://


    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?


  2. Rosen
    Rosen avatar
    3253 posts

    Posted 30 Apr 2015 Link to this post

    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?


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

  3. Eric
    Eric avatar
    1 posts
    Member since:
    Aug 2008

    Posted 04 Jul 2015 in reply to Rosen Link to this post

    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.


  4. Rosen
    Rosen avatar
    3253 posts

    Posted 06 Jul 2015 Link to this post

    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.

    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
  5. Caecilia
    Caecilia avatar
    5 posts
    Member since:
    Feb 2014

    Posted 23 Oct 2016 Link to this post

    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."

  6. Rosen
    Rosen avatar
    3253 posts

    Posted 24 Oct 2016 Link to this post

    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.

    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.
Back to Top