PDA

View Full Version : addTab to TabPanel



oliverbaer
20 Apr 2011, 1:21 PM
Hi,

i am quite new to Sencha (tried it today the first time) and i have my first question:

i want to dynamicly add a tab to a tab panel which contains a ext.list with a datastore. standalone the store and the list works fine, but it will not load when it inside the new created panel.

here is the code:



Ext.getCmp('topPanel').add({
title: record.get('folder_name'),
closable: true,
selected: true,
item: function(record) {
var folder_id = record.get('folder_id');
Ext.regModel('ClippingItem', {
fields: ['asset_id','title']
});
var clippingstore = new Ext.data.JsonStore({
model: 'ClippingItem',
autoload: true,
proxy: {
type: 'scripttag',
url: 'http://portal.local/rest/store/?type=clippinglist&folder_id=' + folder_id
}
});
clippingstore.load();
var clippinglist = new Ext.List({
title: 'Clippinglist',
fullscreen: true,
itemTpl : '{asset_id}',
store: clippingstore
});
clippinglist.show();
}
});


how can i get the content of the new panel loaded?

thx in advance,
oli