PDA

View Full Version : IE 6 and 7 crashes when I use treepanel



gisada
25 Jan 2012, 8:51 AM
Does anybody know why IE 6 and 7 (maybe other versions also) crashes (it works fine in Firefox and Chrome) when I use this code:


Ext.require([
'Ext.tree.*',
'Ext.data.*'
]);

Ext.define('TestGA.view.ViewTree', {
extend: 'Ext.panel.Panel',
alias: 'widget.viewtree',


initComponent: function() {

var me = this;
me.items = [

{

xtype: 'container',
id: 'panelSted',
autoScroll : true,
height : 208,
width : 200,
layout : 'fit',
border : false,
title : 'Sted',
items : [{
xtype : 'treepanel'
}]

}

];
me.callParent(arguments);
}
});

If I change:

items : [{
xtype : 'treepanel'
}]
To:

items : [{
xtype : 'panel'
}]
Then it does not crash.

jay@moduscreate.com
25 Jan 2012, 9:12 AM
first : you're over nesting. why place the tree inside of a container that is inside of a panel?

Just Use the TreePanel itself.

That said, it's hard to tell by just saying "it crashes". Do those browsers have issues in the online examples?

If not, then chances are, you're doing something improperly like not configuring the tree panel with the required config options.

gisada
25 Jan 2012, 2:06 PM
Hi Jay thanks for your answer.

Here is a version of the code without over nesting. The IE browser crashes without any warning it just goes down. It is hard to tell if the online example does work in the browser because the "Live Preview" button does not show. Does that tell you anything? The only required config options is store and this version of the code uses it but it has the same behavior.



Ext.require(['Ext.tree.*', 'Ext.data.*']);

Ext.define('TestGA.view.ViewTree', {
extend: 'Ext.panel.Panel',
alias: 'widget.viewtree',

initComponent: function() {
var store = Ext.create('Ext.data.TreeStore', {
root: {
text: 'Root',
expanded: true,
children: [
{
text: 'Child',
expanded: true,
children: [
{
text: 'Grandchild',
leaf: true
}
]
}
]
}
});
var me = this;
me.items = [
{
xtype: 'treepanel',
id: 'treepanel',
autoScroll : true,
height : 208,
width : 200,
title : 'Sted',
store: store
}
];
me.callParent(arguments);


}
});

jay@moduscreate.com
25 Jan 2012, 4:57 PM
that shouldn't crash ie.


You're still over nesting. The tree panel is a panel, therefore you should probably just extend it!

You're also setting a static ID. That's a problem you should avoid. No more static ids :).

Try using ext-all-debug. does it crash w/ that example?

gisada
26 Jan 2012, 10:53 AM
Than you for your help Jay. You are absolutely right this last version runs alright the problem now seams to be in the viewport. I am relatively new to Ext js and I am waiting for the Ext js 4 in Action book. I find it a bit confusing to try to read the book for version 3 and try to program in version 4. Do you know when it is planed to publish it.