silcreval
4 Oct 2010, 11:26 PM
I'm having some trouble getting a tree to render in a TreePanel. It
doesnt seem to render the tree from the date returned from an Ajax
call. Its a slightly complex example because the tree is inside a tab
panel, inside a panel.
The code is as follows:-
Tree Panel is :-
var nav_tabs_user = new Ext.tree.TreePanel({
title:'User',
useArrows:true,
containerScroll:true,
animate:true,
autoScroll:true,
animate:true,
enableDD:true,
border:false,
loader: {
dataUrl: 'php/getdata.php',
},
root: {
nodeType:'async',
text:'Root',
draggable:false
}
});
The tree is contained in a tabl panel as follows:-
var nav_tabs = new Ext.TabPanel({
defaults : {
autoScroll : true
},
activeTab: 0,
items: [
nav_tabs_user
]
});
Finally the tab panel is rendered in a regular panel
var nav = new Ext.Panel({
title : 'Data',
region : 'west',
split : true,
width : 200,
collapsible : true,
collapseMode : 'mini',
items: nav_tabs
});
The data returned from the getdata.php call is
[{ id: "1": text: "No Children", leaf: true}]
Firebug confirms the response data is as above (I just cut and paste).
Any idea how to start debugging this?
Thanks
doesnt seem to render the tree from the date returned from an Ajax
call. Its a slightly complex example because the tree is inside a tab
panel, inside a panel.
The code is as follows:-
Tree Panel is :-
var nav_tabs_user = new Ext.tree.TreePanel({
title:'User',
useArrows:true,
containerScroll:true,
animate:true,
autoScroll:true,
animate:true,
enableDD:true,
border:false,
loader: {
dataUrl: 'php/getdata.php',
},
root: {
nodeType:'async',
text:'Root',
draggable:false
}
});
The tree is contained in a tabl panel as follows:-
var nav_tabs = new Ext.TabPanel({
defaults : {
autoScroll : true
},
activeTab: 0,
items: [
nav_tabs_user
]
});
Finally the tab panel is rendered in a regular panel
var nav = new Ext.Panel({
title : 'Data',
region : 'west',
split : true,
width : 200,
collapsible : true,
collapseMode : 'mini',
items: nav_tabs
});
The data returned from the getdata.php call is
[{ id: "1": text: "No Children", leaf: true}]
Firebug confirms the response data is as above (I just cut and paste).
Any idea how to start debugging this?
Thanks