Changes between Initial Version and Version 1 of Ticket #9058


Ignore:
Timestamp:
Apr 4, 2009, 5:49:54 AM (11 years ago)
Author:
bill
Comment:

Sounds like grid is doing sizing on creation when it should be waiting for the resize() call (if it is inside a layout container). I thought we fixed this for 1.3 but maybe not... to confirm, this is happening in 1.3 and not just 1.2?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9058 – Description

    initial v1  
    11I have a page with a Dialog that contains a Grid. The URL for the store for the grid varies depending on what source link spawned the request (a link in a grid row).  I create the store and Grid programmatically when the source link is clicked.  Some of the source links will result in a JSON object with an "items" list that is not empty.  This has no problem.  Some of the source links will result in a JSON object an empty "items" list.  Although this should be perfectly fine, which should result in a grid showing 0 rows, it instead throws the following error:
    2 
     2{{{
    33    TypeError: this.headerContentNode.firstChild is null
    4 
    5 I've tracked this down to the following in DataGrid.js.uncompressed.js:
    6 
     4}}}
     5I've tracked this down to the following in !DataGrid.js.uncompressed.js:
     6{{{
    77    getColumnsWidth: function(){
    88            return this.headerContentNode.firstChild.offsetWidth; // Integer
    99    }
    10 
     10}}}
    1111In my test case, "this.headerContentNode.firstChild" is null, so this results in an error.  There are six other locations in this file that make a similar dereference to "firstChild", which will throw an error if executed in a similar test case.
    1212
    1313I can see that a "simple-minded" fix for this, like returning zero in a case like this, would NOT be sufficient, as the Grid still needs to have the same width that it does when it has data.
    1414
    15 I've built a standalone test case for this, which I'll attach, but unfortunately I can't be sure it will ever demonstrate the problem, because I'm running up against a different bug, [http://trac.dojotoolkit.org/ticket/9046] . I've tried numerous variations to try to avoid this in the test case, to no avail. I'm not sure now why my original application doesn't demonstrate this other problem.
     15I've built a standalone test case for this, which I'll attach, but unfortunately I can't be sure it will ever demonstrate the problem, because I'm running up against a different bug, #9046. I've tried numerous variations to try to avoid this in the test case, to no avail. I'm not sure now why my original application doesn't demonstrate this other problem.