PDA

View Full Version : Creating JSON object and populating tree



anniejose
5 Apr 2008, 4:41 AM
Hi,

I am new to Ext-js and JSON.

I have a JSON object which is to be populated in a tree.

The following is the JSON object I have. The name of this JSON object is 'PRODUCT'

[{ "objects":
{[ "objects":
{[ "objects":
{[ "objects":
{"objects":[], "captionName":"Anniversary"}],
"captionName":"ANYONE"}],
"captionName":"ANYONE"}],
"captionName":"ANNIV CONG"}],
"captionName":"ANNIV"}]

This is the code I have for populating the tree

tree = new Ext.tree.ColumnTree({
el:'node-tree',
rootVisible:false,
columns:[{
header:'Product',
width:300,
resizable: true,
dataIndex:'captionName'
}],

loader: new Ext.tree.TreeLoader({
dataUrl: 'PRODUCT',
uiProviders:{
'col': Ext.tree.ColumnNodeUI
}
}),
root : new Ext.tree.AsyncTreeNode({
text:'Product'
})
});
tree.render();

I am unable to generate the tree-grid.

Thanks in advance.

Regards,
Annie