PDA

View Full Version : treemenu and IE8 not expanding



ext.Will
7 Oct 2009, 8:51 AM
Hello all. I searched around, but couldn't find an answer to this issue i'm having. I am testing out a simple treemenu in a border layout and creating the tree in the west panel. Simple enough and I have been working in Firefox and things work just fine. Then, I testing in IE8 and everything works except the tree won't expand nor display past the root node at all? I am stuck at this point. Can anyone see a problem in my test code?
I left out the non relevant portions of the code, but here is everything that has to do with the tree and the div it is assigned to.
Any ideas?



So, in Firefox the tree correctly looks like:

- Pubdate
|
- A
|-01
|-02
|-03
- B
|-01
|-02
|-03
- C
|-01
|-02
|-03

But, in IE8, the tree incorrectly looks like

- Pubdate



thanks!



Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();

var myviewport = new Ext.Viewport({
layout: 'border',
id: 'fullport',
items: [
{
region: 'east',
title: 'Ads This Page',
contentEl: 'east',
split: true,
width: 175,
minSize: 175,
maxSize: 175,
collapsible: true,
//autoScroll: true,
margins: '0 0 0 0'
},
{
xtype: 'panel',
region: 'west',
//title: 'Please Login',
id: 'west-panel',
width: 250,
minSize: 20,
maxSize: 400,
autoScroll: true,
collapsible: true,
layout: 'fit',
split: 'true',
items:
new Ext.TabPanel({
border: false,
activeTab: 0,
defaults:{autoScroll:true,border:false},
items:[
{
title: 'Contents',
contentEl: 'contentstab',
iconCls: 'navtab'
},
{
title: 'Search',
contentEl: 'searchtab',
iconCls: 'searchtab'
},
{
title: 'Weather',
contentEl: 'weathertab',
iconCls: 'weathertab'
}
]
})
},
{
xtype: 'panel',
region: 'center',
margins: '0 0 0 0',
contentEl: 'centerregion',
id: 'c-centerregion',
listeners: {
resize : function(){
/*console.log(arguments); */
resizeshowpage(this.getWidth(),this.getHeight());
newimgwidth = this.getWidth();
newimgheight = this.getHeight();
}
}
}
]
});

// get current pubdate
var currentpubdate = document.getElementById("statusdate").value;

var tree = new Ext.tree.TreePanel({
renderTo: 'tree-div', // div is defined in html source below
id: 'contentstree',
layout: 'fit',
animate: true,
rootVisible: true,
frame: false,
root: {
nodeType: 'async',
text: 'Pubdate'
},
dataUrl: 'tree/check-nodes.php?pd='+currentpubdate,
listeners: {
'render': function(tp){
tp.getSelectionModel().on('selectionchange',function(tree, node){
//var el = Ext.getCmp('details-panel').body;
showpagesrc = node.attributes.filename;
if (showpagesrc != undefined)
{
showpagesrc = node.attributes.filename;
}

// display the page that was clicked on
resizeshowpage(newimgwidth,newimgheight)
})
}
}
});
tree.getRootNode().expand(true);
//Ext.getCmp('contentstree').root.expand();



Ext.get("reloadtree").on('click',function(){
currentpubdate = document.getElementById("statusdate").value;
tree.getLoader().dataUrl = 'tree/check-nodes.php?pd='+currentpubdate;
tree.root.reload();
tree.getRootNode().expand(true);
});






<div id="contentstab" class="x-hide-display">
<div id="tree-div"></div>
</div>

rblon
7 Oct 2009, 11:28 AM
Can you post the php file? Or even better: just the output/response?

ext.Will
7 Oct 2009, 12:07 PM
Can you post the php file? Or even better: just the output/response?

Yup, here is the output of the php file.
Thanks for taking a look!



[{ text: '10-07-08', cls: 'folder', children: [{ text: '01', leaf: true, filename: 'test100.jpg', },{ text: '02', leaf: true, filename: '4_A_01_W_MR_081309_.jpg' },{ text: '03', leaf: true, filename: '091209/2_A_03_test.jpg' }] },{ text: 'B', cls: 'folder', children: [{ text: '01', leaf: true, filename: '4_A_01_W_MR_081309_.jpg' },{ text: '02', leaf: true, filename: '091209/2_B_02_test.jpg' },{ text: '03', leaf: true, filename: '091209/2_B_03_test.jpg' }] },{ text: 'C', cls: 'folder', children: [{ text: '01', leaf: true, filename: '091209/2_C_01_test.jpg' },{ text: '02', leaf: true, filename: '091209/2_C_02_test.jpg' },{ text: '03', leaf: true, filename: '091209/2_C_03_test.jpg' }] }]

rblon
7 Oct 2009, 12:41 PM
haven't tried your code, but i notice a trailing comma in the php output (first child). Perhaps that's causing it, as IE is less forgiving?

ext.Will
7 Oct 2009, 12:59 PM
haven't tried your code, but i notice a trailing comma in the php output (first child). Perhaps that's causing it, as IE is less forgiving?


Damn, rblon, you are a freak of nature. Nice catch! That was it.
I must have stared at all of that for a few days now.

thank you.

rblon
7 Oct 2009, 1:04 PM
cool
IE and the trailing comma... been there before, so know what to look for