View Full Version : How to load EXT tree in version 3.2

16 Aug 2012, 3:59 AM
Hello all
I am using EXT 3.2 for loading tree . The overall code is as follows.

var treePanel = new Ext.tree.TreePanel({
useArrows : true,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
rootVisible : false,
loader: new Ext.tree.TreeLoader({
dataUrl: '${pageContext.servletContext.contextPath}/endeca?tree',
preloadChildren: true,
requestMethod: 'GET'
root: {
nodeType: 'async',
text: 'Ext JS',
expanded : true,
draggable: false,
id: 'treeModel'

Though in this case my JSON is having some custom root. The JSON structure is as follows.

{"treeModel":[{"id":"Node1","text":"Node 1","leaf":false},{"id":"Node2","text":"Node 2","leaf":false},{"id":"Node4","text":"Node 4","leaf":false}]}

Here I have root as "treeModel" and there is no way I can change this. My tree may be not understanding what is the root because of which tree is not getting rendered. Is there any way I can specify root for my tree ? Is there anything like "reader" for tree ? If it is there can anyone please tell me how to use it.
Thanks in advance

16 Aug 2012, 6:12 AM
Be careful, you're not in Extjs3 forum : http://www.sencha.com/forum/forumdisplay.php?39-Ext-JS-Community-Forums-3.x

16 Aug 2012, 5:52 PM
Sorry about that...My bad :(