PDA

View Full Version : How to load 'items' using AJAX?



hrwath
2 Feb 2010, 10:46 AM
Hello.

I'm totally new to ExtJS and I can't handle one thing:
I want to dynamically load items for Panel (GroupTabPanel) but I don't know how to do it. I tought that I'd get it through JSON but I don't know if I got the point. Maybe there's another way to load item structure?

I'd appreciate any hints and tips on this issue.


var viewport = new Ext.Viewport({
layout: 'fit',
items: [{
id: 'sgrptabpanel',
xtype: 'grouptabpanel',
tabWidth: 130,
activeGroup: 0,
// i want to load items below
items: [{
items: [{
xtype: 'portal',
title: 'Zasoby',
tabTip: 'Zasoby u?ytkownika'
},{
title: 'Dokumenty',
iconCls: 'sfy-icon-script',
layout: 'fit',
style: 'padding: 10px',
items: [
new Ext.grid.GridPanel({
layout: 'fit',
store: dStore,
columns: [
{id: 'fname', header: 'Nazwa pliku', width: .66, sortable: true, renderer: gridIconRenderer, dataIndex: 'fname'},
{header: 'Rozmiar', sortable: true, renderer: gridSizeRenderer, dataIndex: 'size'}
],
stripeRows: true,
autoExpandColumn: 'fname'
})
]
},{
title: 'Muzyka',
iconCls: 'sfy-icon-music',
layout: 'fit',
style: 'padding: 10px'
},{
title: 'Obrazy',
iconCls: 'sfy-icon-pictures',
layout: 'fit',
style: 'padding: 10px'
}]
},{
items: [{
xtype: 'portal',
title: 'Ustawienia'
},{
title: 'U?ytkownik',
iconCls: 'sfy-icon-user',
layout: 'fit',
style: 'padding: 10px'
}]
}]
}]
});