PDA

View Full Version : Portals, Portlets and Tabs, halp plz



RHamilton
24 Oct 2007, 10:52 AM
I am really new to Ext, have only been working with it for about 4 days. So if the code is bad and hurts your eyes sorry in advance.

Anyways, I cannot figure out how to insert a portlet (basically a panel from what I understand) into a portal (another panel). I have tried to make a viewport I get the portlets to show up but at the top of the page and not into the tab where I want it, and when I use the appyTo I get an ID error of not valid. I have tried to use the 'items[{},{}]' when I extend to the panel and it errors saying not a valid function. Lastly I have tried to use the add function (in the code below) which also comes back as not valid.

Here is some code that I created with help from examples and co-workers



Dashboard = function(){

Dashboard.superclass.constructor.call(this, {
title: "Dashboard2",

id: "dpanel",
loadMask: {msg: "Loading Dashboard ..."},
autoScroll: true,
enableDragDrop: true
});

this.on('activate', this.onActivate, this);
}

Dashboard = Ext.extend(Dashboard, Ext.Panel, {
layout: 'column',
autoScroll:true,
cls:'x-portal',
defaultType: 'portalcolumn',

initComponent : function(){
Dashboard.superclass.initComponent.call(this);
this.addEvents({
validatedrop:true,
beforedragover:true,
dragover:true,
beforedrop:true,
drop:true
});
},

initEvents : function(){
Dashboard.superclass.initEvents.call(this);
this.dd = new Dashboard.DropZone(this, this.dropConfig);
},

onActivate: function(event){

DashboardPortlet = Ext.extend(Ext.Panel, {
anchor: '100%',
frame:true,
collapsible:true,
draggable:true,
cls:'x-portlet'
});

Dashboard.add(DashboardPortlet);
}
});
Ext.reg('portal', Dashboard);

Dashboard.DropZone = function(portal, cfg){
this.portal = portal;
Ext.dd.ScrollManager.register(portal.body);
Dashboard.DropZone.superclass.constructor.call(this, portal.bwrap.dom, cfg);
portal.body.ddScrollConfig = this.ddScrollConfig;
};

Ext.extend(Dashboard.DropZone, Ext.dd.DropTarget, {
//Drag and Drop placement code etc...
});

Dashboard is the tab, I make the tab a panel and then I try to insert the other panel into the first (I think :-/)

Any help would be appreciated.



Ryan Hamilton