PDA

View Full Version : [SOLVED] Treepanel using json store.



pirusira
24 Jun 2010, 6:47 PM
Hello all.

I want to make a treepanel using json store.

This is my json store


var groupTreeStore = new Ext.data.JsonStore({
url: 'GroupDataCollector.action',
root: 'groupInfo',
idProperty: 'id',
fields: [
'id',
'text'
]
});
groupTreeStore.load();


And this is my treepanel


var groupTreePanel = {
xtype: 'treepanel',
id: 'groupTreePanel',
rootVisible: false,
root: {
text: 'tmpRoot',
id: 'tmpRoot',
expanded : true
},
loader: new Ext.tree.TreeLoader({
url: 'GroupDataCollector.action'
})
};


How do I put the json store's json data in the treepanel?

Thanks in advance.
Stan

pirusira
24 Jun 2010, 8:10 PM
I modified the thread.
Any ideas?

rohangpatil
24 Jun 2010, 8:45 PM
Hi,

Dont use a store!

The "loader" is ready to consume the JSON returned by your action class.. Check the format in the Extjs Treeloader API.

pirusira
27 Jun 2010, 10:26 PM
Yeah that's true.
Thank you for answer, rohangpatil.