-
24 Jul 2012 7:18 AM #1
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?
-
24 Jul 2012 9:00 AM #2
We will need a working example. Please follow our bug report template:
http://www.sencha.com/forum/showthre...o-report-a-bug
Regards,
Scott.
-
24 Jul 2012 11:25 PM #3
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(); });
-
24 Jul 2012 11:36 PM #4
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!
-
24 Jul 2012 11:44 PM #5
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.
-
26 Aug 2012 3:43 PM #6
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?
-
16 Nov 2012 12:49 PM #7
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.
-
18 Nov 2012 9:30 PM #8
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!
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote