PDA

View Full Version : [3.0RC2] Why this tree is not working in IE



bahar
8 Jun 2009, 6:59 AM
This is working in 3.0RC1 and 2.2 on both FireFox and IE but when using 3.0RC2 it's not working in IE!



var tree = new Ext.tree.TreePanel({
el: 'tree-div',
useArrows: true,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
border: false,

dataUrl: 'get-nodes.php',

root: {
nodeType: 'async',
text: 'Ext JS',
draggable: false,
id: 'source',
children: [{
text: "One",
leaf: true
}, {
text: "Two",
leaf: false
}]
}
});

tree.render();
tree.getRootNode().expand();

Animal
8 Jun 2009, 7:03 AM
Do not use el Where did you get the idea for that from?

Render the Tree to somewhere.

bahar
8 Jun 2009, 7:12 AM
That's the sample from TreePanel Documentation page!
Anyways the same thing happens when you embed it in a Window. It works in FireFox but not IE.



var win = new Ext.Window({
title: 'Sample Tree',
width: 250,
height: 300,

items: new Ext.tree.TreePanel({
useArrows: true,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
border: false,

dataUrl: 'get-nodes.php',

root: {
nodeType: 'async',
text: 'Ext JS',
draggable: false,
id: 'source',
children: [{
text: "One",
leaf: true
}, {
text: "Two",
leaf: false
}]
}
})
});

win.show();
win.items.items[0].getRootNode().expand();

Animal
8 Jun 2009, 7:18 AM
There's something else going wrong then somewhere else.

Run your page in IE8 to see if taht gives more info.

bahar
8 Jun 2009, 7:31 AM
This is what IE debug console console:



Message: Object expected
Line: 28990
Char: 13
Code: 0
URI: http://localhost/ext3/ext-all-debug.js

Animal
8 Jun 2009, 7:33 AM
So you have get-nodes.php on the server your test page was served from?

bahar
8 Jun 2009, 8:02 AM
The error happens after calling the expand on root node which does not call get-nodes.php because it already has children.
get-nodes.php is already on the server and everything works on FireFox.

8 Jun 2009, 8:06 AM
Do not use el Where did you get the idea for that from?

Render the Tree to somewhere.

examples. i need to clean up the examples.

Animal
8 Jun 2009, 9:27 AM
I just fixed the docs comments in the 3.0 SVN code.

cfhank
8 Jun 2009, 9:50 AM
http://extjs.com/deploy/ext-3.0-rc2/examples/tree/column-tree.html

dont work, way?

EDIT: dont work on IE, Firefox is ok.

wenner
9 Jun 2009, 12:38 AM
This is what IE debug console console:



Message: Object expected
Line: 28990
Char: 13
Code: 0
URI: http://localhost/ext3/ext-all-debug.js


http://extjs.com/deploy/ext-3.0-rc2/examples/tree/column-tree.html

I encountered the same error, and similarly, the above example don't work on IE (6,7,8)

and the same code working in 2.0 2.2 is ok

bahar
9 Jun 2009, 8:37 PM
Looks like this is not only my problem and happens for others too. No solution yet?

tryanDLS
10 Jun 2009, 9:32 AM
This may have been related to http://extjs.com/forum/showthread.php?t=70607.

In any case, testing with SVN code post RC2 seems to work ok with IE6/8.

axgle
16 Jun 2009, 3:16 AM
The error happens after calling the expand on root node which does not call get-nodes.php because it already has children.
get-nodes.php is already on the server and everything works on FireFox.
The error happens after calling the expand on root node.
yes,and how to fix it?

cfhank
16 Jun 2009, 9:25 AM
FIX:

Ext.override(Ext.tree.TreeLoader, {
runCallback: function(cb, scope, args){
if(Ext.isFunction(cb)){
cb.apply(scope, args || []);
}
}
});

axgle
16 Jun 2009, 5:21 PM
FIX:


Ext.override(Ext.tree.TreeLoader, {
runCallback: function(cb, scope, args){
if(Ext.isFunction(cb)){
cb.apply(scope, args || []);
}
}
});
:),thanks~

23 Jun 2009, 11:21 PM
the code works well in Firefox,
but in ie, the code don't work if you use extjs3.0, the code work well if you use extjs2.0.

23 Jun 2009, 11:32 PM
FIX:

Ext.override(Ext.tree.TreeLoader, {
runCallback: function(cb, scope, args){
if(Ext.isFunction(cb)){
cb.apply(scope, args || []);
}
}
});

thanks, add this,the problem has fixed.
though i don't understand,but very thank for you!

Dragon-Earth
3 Feb 2011, 2:42 AM
Still not able to view the child node of Async Root Node in internet explorer,but works fine in FF.The following is code,if you can help and suggest any option


PaxInfo = function() {
return {
PaxInfoWindow : function(app, travellerProfileId, includeCoTraveller,
organizationId, isUsFlight) {
var Tree = Ext.tree;
var tree = new Tree.TreePanel( {
loader : new Ext.tree.TreeLoader(),
id : 'tree'
});
var root = new Tree.AsyncTreeNode( {
text : 'services',
cls : 'folder',
id : 'source',
isTarget : false,
// expanded:false, (this tried but didnt work)
children : [ {
id : '1',
text : 'Menu1',
leaf : true
}, {
id : '2',
text : 'Menu2',
leaf : true
} ]
});
tree.setRootNode(root);
var desktop = app.getDesktop();
var win = desktop.getWindow('paxInfoMappingWin');
alert(win);
if (!win) {
var win = desktop.createWindow( {
title : 'PaxInfo Mapping',
id : 'paxInfoMappingWin',
border : false,
width : window.screen.availWidth,
height : window.screen.availHeight - 175,
x : 0,
y : 0,
shim : false,
layout : 'fit',
items : tree
});
}
win.show();
}
};
}(); Please Help