PDA

View Full Version : [OPEN] [CLOSED][B3] Grid + Window Show/Close = el is undefined



ldonofrio
15 Apr 2011, 10:38 AM
To reproduce, run the following code, click "show win" (in grid toolbar) and "close win" (in win fbar) until you get the error.



var states = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
//...
]
});
var view = Ext.widget('viewport',{
title: 'Fit Panel',
layout: 'fit',
items: {
xtype: 'grid',
title: 'Grid',
store: states,
columns:[
{ name: 'abbr', text: 'abbr', dataIndex: 'abbr' }, { name: 'name', text: 'name', dataIndex: 'name' }
],
tbar: {
xtype: 'toolbar',
items: [{
text: 'show win',
handler: function(){
var win = Ext.widget('window', {
width: 600,
height: 400,
modal: true,
buttons: [
{
text: 'close win',
handler: function(){
win.close();
/*
var f=function(){
win.close();
}
Ext.Function.defer(f, 100);
*/
}
}
]
});
win.show();
}
}]
}
}
});
});


A simple workaround is to defer the win.close execution, see Ext.Function.defer(f, 100);

evant
15 Apr 2011, 4:31 PM
I can't reproduce this. I clicked open/close around 20 times and didn't receive any exceptions.

How do I go about getting the error to throw?

ldonofrio
16 Apr 2011, 7:14 AM
Hi evant, please try to hover the grid headers inmediately after clicking "show win", then when you click "close win" you got the exception.

Is hard to reproduce on FF but it happens, you can try this in IE8 and you ever got the exception.

Here are s25674o25673me screens

Thanks


I can't reproduce this. I clicked open/close around 20 times and didn't receive any exceptions.

How do I go about getting the error to throw?

ldonofrio
18 Apr 2011, 8:32 AM
Same problem with card layout and grid.

Click "goto item 1" and then "goto item 0", very easy to reproduce in IE

Thanks

Code:


Ext.onReady(function(){
var states = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
//...
]
});

var pnl = Ext.widget('panel', {
renderTo: document.body,
width: 600,
height: 400,
title: 'card layout',
layout: 'card',
activeItem: 0,
items: [{
xtype: 'grid',
title: 'testing grid at card 0',
store: states,
columns:[
{ name: 'abbr', text: 'abbr', dataIndex: 'abbr' }, { name: 'name', text: 'name', dataIndex: 'name' }
],
tbar: [{
text: 'Goto item 1',
handler: function(){
pnl.getLayout().setActiveItem(1);
}
}]
},{
items: {
xtype: 'panel',
title: 'testing panel at card 1',
html: 'testing content',
tbar: [{
text: 'Goto item 0',
handler: function(){
pnl.getLayout().setActiveItem(0);
pnl.remove(1, true);
}
}]
}
}]
});
});

ykey
18 Apr 2011, 12:18 PM
Might be related to this: http://www.sencha.com/forum/showthread.php?130518-Card-Layout-component-deactivation-destruction-lifecycle-problem

evant
18 Apr 2011, 2:48 PM
I tried your code against B3 and the latest from source and wasn't able to reproduce it in any browser.

Can anyone confirm?

ykey
18 Apr 2011, 3:45 PM
Yes able to verify both examples in FF4 and Chrome 10 in B3.

ykey
18 Apr 2011, 4:06 PM
Uncaught TypeError: Cannot read property 'style' of undefined
Ext.override.getStyle.view.view.getComputedStyle.el ext-core-debug.js:13037
Ext.override.isStyle ext-core-debug.js:13019
isVisible ext-core-debug.js:18867
anonymous:2
filterItems ComponentQuery.js:105
cq.Query.Ext.extend.is ComponentQuery.js:313
Ext.apply.is ComponentQuery.js:416
Ext.apply.focusable.is FocusableFocusManager.js:168
Ext.apply.focusable FocusManager.js:173
filterByPseudo ComponentQuery.js:206
filterItems ComponentQuery.js:105
cq.Query.Ext.extend.is ComponentQuery.js:313
Ext.apply.is ComponentQuery.js:416
Ext.define.on ComponentFocusFocusManager.js:484
(anonymous function) ext-core-debug.js:2093

dmN86
19 Apr 2011, 4:05 AM
Hi,

Sorry form my bad english :s

I have same problem.
I was working with MVC examples, and when I was closing window:
"Uncaught TypeError: Cannot read property 'style' of undefined"

Chrome 10.0.648.205

Same issue on example "feed-viewer" - try click "Cancel" on Add feed window

ldonofrio
19 Apr 2011, 6:17 AM
Exactly, thanks guys for reporting too, i've redownloaded the B3 and still getting the error on win764/w2k/wXP FF and IE

here is the complete html (maybe it's usefull)


<html>
<head>
<link rel="stylesheet" type="text/css" href="ext-4.0-beta3/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-4.0-beta3/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var states = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
//...
]
});
var view = Ext.widget('viewport',{
layout: 'fit',
items: {
xtype: 'grid',
title: 'Grid',
store: states,
columns:[
{ name: 'abbr', text: 'abbr', dataIndex: 'abbr' }, { name: 'name', text: 'name', dataIndex: 'name' }
],
tbar: {
xtype: 'toolbar',
items: [{
text: 'show win',
handler: function(){
var win = Ext.widget('window', {
width: 600,
height: 400,
modal: true,
buttons: [
{
text: 'close win',
handler: function(){
win.close();
/*
var f=function(){
win.close();
}
Ext.Function.defer(f, 100);
*/
}
}
]
});
win.show();
}
}]
}
}
});
});
</script>
</head>
<body>
</body>
</html>

evant
19 Apr 2011, 6:39 AM
Ok, I can get the second test case to cause an error in IE. I checked it against the latest source build and the issue doesn't persist, please confirm when the next release comes out.

ldonofrio
19 Apr 2011, 6:55 AM
thanks evant, i will check that

ldonofrio
26 Apr 2011, 8:18 AM
i confirm that both issues are solved in the final release

thanks