PDA

View Full Version : Ragarding about Tree panel store



Paramesh S K
22 May 2014, 4:08 AM
Hi friends, Can u tell me How to use store for treepanel. I am using Extjs3.4

Here i have a json data of 5 level tree coming from backend, i dont know how i can get the response and load the data in tree panel store. Here is my code

var viewport = new Ext.Viewport({ title:'myviewport',
layout:'border',
items:[{
region:'north',
title:'north panel',
frame:true,
width:50
},
{
region:'west',
title:'west panel',
width:100,
// collapsed:true,
//collapsible:true,
frame:true
},
{
region:'center',
title:'tree panel',
frame:true,
items:[{
xtype:'panel',
title:'Trees',
items:[{
xtype:'treepanel',
frame:true,
autoHeight:true,
width:200,
autoScroll: true,
animate: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
text: 'Autos',
expanded: true,
children: json
}),
listeners:{
click:function(n)
{
Ext.Msg.alert(''+n.attributes.text+'');
var val = ''+n.attributes.text+'';
Ext.Ajax.request({
url:'treestoreaction.action',
method: 'POST',
params:{
val:val
}
})
}
}
}
]
}]
}]
});


Please refer the above code ...Thanks in advance..