PDA

View Full Version : [FIXED-EXTJSIV-188] Errors closing grid.



James Goddard
21 Mar 2011, 11:14 AM
If you try to close a grid that hasn't been made visible, you get errors. There are a couple of errors with different cases:

1. Grid in a tabpanel that hasn't been activated:

Ext.onReady (function () {
Ext.regModel ('testModel', { fields: [ 'x' ] });

var wnd = Ext.create ('Ext.window.Window', {
layout: 'fit',
width: 500,
height: 500,
items: [{
xtype: 'tabpanel',
items: [{
xtype: 'panel',
title: '1'
}, {
xtype: 'grid',
title: '2',
headers: [{ text: 'column 1', dataIndex: 'x' }],
store: Ext.create ('Ext.data.Store', {
model: 'testModel',
data: [
{ x: 1 },
{ x: 2 },
{ x: 3 }
]
})
}]
}]
});
wnd.show ();
});


This gives: Uncaught TypeError: Cannot read property 'width' of undefined

2. Grid in a card layout that hasn't been activated:

Ext.onReady (function () {
Ext.regModel ('testModel', { fields: [ 'x' ] });

var wnd = Ext.create ('Ext.window.Window', {
layout: 'card',
width: 500,
height: 500,
items: [{
xtype: 'panel',
title: '1'
}, {
xtype: 'grid',
title: '2',
headers: [{ text: 'column 1', dataIndex: 'x' }],
store: Ext.create ('Ext.data.Store', {
model: 'testModel',
data: [
{ x: 1 },
{ x: 2 },
{ x: 3 }
]
})
}]
});
wnd.show ();
});


This gives: Uncaught TypeError: Cannot read property 'width' of undefined

In both samples you'll need to close the window by clicking the 'X' to get the error.

AlxH
21 Mar 2011, 12:00 PM
Its propably because a 'card' layout and a tabpanel must have an 'activeItem' configuration.

regards,
Alex

James Goddard
21 Mar 2011, 12:04 PM
The fit layout above does have only 1 item (tab panel).

It still occurs in the second with an activeItem.

aconran
23 Mar 2011, 6:37 PM
This has been fixed for the next release (after PR5.)

scottmartin
23 Mar 2011, 7:09 PM
... next release (after PR5.)

.... analyzing sentence, please wait ....

RESULT: Aaron is messing with everyone who is waiting for the first BETA release!

James Goddard
7 Apr 2011, 5:32 AM
Number 1 is still occuring (Beta 2)

Number 2 has a different error now:

Uncaught TypeError: Cannot call method 'destroy' of undefined

This is when trying to destory the Ext.grid.HeaderReorderer which is not being turned on in the code??

evant
7 Apr 2011, 6:05 AM
1) Can't confirm

2) Resolved here: http://www.sencha.com/forum/showthread.php?129411-FIXED-EXTJSIV-706-Beta-2-GridPanel-with-gridviewdragdrop

James Goddard
7 Apr 2011, 8:12 AM
My bad, 1 and 2 should both be resolved with http://www.sencha.com/forum/showthre...idviewdragdrop.