Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    10
    Vote Rating
    0
    alonweiss is on a distinguished road

      0  

    Default Ext.grid.ColumnLayout [4.1.1]

    Ext.grid.ColumnLayout [4.1.1]


    I'm having a hard-time replicating a runtime exception I'm having with a treegrid inside a window.
    The treegrid is the only child of a window, and whenever I expand a node which causes a vertical scrollbar to appear, I'm getting a runtime exception in calculate(): viewContext.tableContext is undefined.

    This previously worked in 4.0.7 and got broken in 4.1.1. Comparing the files shows that there has been a significant change in that file. Unfortunately the inner-workings of the optimized layout effort are not documented, so I have no idea what tableContext is, or why it's undefined.

    As a workaround, I added if(viewContext.tableContext) and things started working again.

    Strangely enough, if I set 'animate' to true (I turned it off in my product), it works as expected.

    Help, anyone?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,000
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    We will need a working example. Please follow our bug report template:
    http://www.sencha.com/forum/showthre...o-report-a-bug

    Regards,
    Scott.

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    10
    Vote Rating
    0
    alonweiss is on a distinguished road

      0  

    Default calling setWidth() with the same width as the control

    calling setWidth() with the same width as the control


    After further investigation it turns out that the root of the problem was that I handled the 'columnresize' event of the grid and called column.setWidth() with the same value.
    Instead of checking if the new width is different from the current width, this triggered updateLayout(), which subsequently crashed in Ext.grid.ColumnLayout.calculate()

    Here's a reproduction for this:

    Code:
    Ext.onReady(function ()
            {
                Ext.create('Ext.Window', {
                    title: 'bug',
                    width: 400,
                    height: 160,
                    x: 10,
                    y: 450,
                    plain: true,
                    modal: true,
                    layout: 'border', 
                    items: {
                        xtype: 'treepanel',
                        region: 'center',
                        border: false,
                        hideHeaders: true,
                        columns: [{ xtype: 'treecolumn', text: 'Name', dataIndex: 'text', flex: 1, padding: '10 10 10 10', draggable: false, hidable: false}],
                        listeners:
                        {
                            columnresize: function (container, column, width, opts)
                            {
                                column.setWidth(width);
                            }
                        }
                    },
                }).show();
            });

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,917
    Vote Rating
    630
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Obviously the code is for the sake of example, but why are you manually setting the width on it after the column gets resized?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    10
    Vote Rating
    0
    alonweiss is on a distinguished road

      0  

    Default


    Well naturally I don't, directly. This was just a simplification of the issue.
    In my application, a class that wraps the grid component container some the logic that at some point called setWidth(). Once I found it I fixed it, but this does not mean that calling setWidth() should be unsafe during the columnresize event or updateLayout() etc.

  6. #6
    Ext JS Premium Member dnorman's Avatar
    Join Date
    Jan 2011
    Posts
    101
    Vote Rating
    38
    dnorman has a spectacular aura about dnorman has a spectacular aura about dnorman has a spectacular aura about

      0  

    Default


    I'm experiencing this issue as well, except that it's not during a columnresize event, it's due to my ColumnAutoWidth plugin calling setWidth after catching a (buffered) refresh event.

    I don't see why it's ok for setWidth to ever cause a crash. Docs on the layout stuff would be nice too.

    This thread is still marked as "not enough information" even though alonweiss has submitted a reproduction scenario. Is this sufficient to get this looked at? or shall I resubmit his reproduction in another thread?

  7. #7
    Ext JS Premium Member dnorman's Avatar
    Join Date
    Jan 2011
    Posts
    101
    Vote Rating
    38
    dnorman has a spectacular aura about dnorman has a spectacular aura about dnorman has a spectacular aura about

      0  

    Default


    What's the status of this? I'm still experiencing this issue.
    alonweiss provided a good reproduction case back in July. It should not be marked as needing more information.

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,917
    Vote Rating
    630
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    It would be useful to see a real world test case, the one provided above is a bit contrived.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!