PDA

View Full Version : How to dynamically add portlets



Maharshi
29 Jun 2009, 2:02 PM
Hi ,

I am having trouble adding a new portlet dynamically into a portal.
I took the example from the samples/demo ,the items are added thru config in it.
My code looks like this.

//homet is one of the tab from a tabpanel
var homet = Ext.getCmp('homeTab');

homet.add({
// xtype:'portalcolumn',
title:'I am Dynamic !! '+text,
tools:[{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}],
html:"<h3>I am dynamic !!</h3>"
});

homet.doLayout();

Please help if i am doing something wrong here.
Thnks

chesstrix
29 Jun 2009, 7:19 PM
tools is not a valid config item for a panel.
Try tbar

Also, please read how to post code.