PDA

View Full Version : Extjs 4 portlet on load collapsed not working properly



AtulDawkhare
31 May 2012, 5:03 AM
Hi
I
am using ExtJS 4 portal code in my application

I want to make portlet in collapsed state at the time of loading the page. So I have done something like




items: [{
id: 'portlet-1',
title: 'Grid Portlet Texsds',
tools: this.getTools(),
height:200,
collapsed:true,
autoScroll :true,
items: Ext.create('Ext.app.GridPortlet'),
listeners: {
'close': Ext.bind(this.onPortletClose, this),
'endDrag': Ext.bind(this.onPortletDrag, this),
'resize' :Ext.bind(this.onPortletResize, this)
}
}



I have made collapsed property to true. But because of this when I am trying to expand the portlet [after page load using the

panelHeader.ownerCt.expand();
] I can see blank Grid.Plz. refer the attached image



35796


I have added getTool's one more type i.e Minimize code for that as below.




{
type: 'Minimize',
handler: function(e,target,panelHeader,tool){
if (panelHeader.ownerCt.collapsed)
{
panelHeader.ownerCt.expand();


}
else {
panelHeader.ownerCt.collapse();
}
}
}



My requirement is , user log in then he minimize the portlet and log out , when he log in again then he should be able to see the portlet in minimize state, [which I am able to achieve], then he may expand the portlet , at that time he should be see the grid, which In my case I can see the blank grid.

Hope I am able to explain well.

I am not sure what is missing here, Please suggest.me

mitchellsimoens
7 Jun 2012, 12:50 PM
Do you have the portlet collapsed or the portal column?

AtulDawkhare
7 Jun 2012, 9:44 PM
Hi ,

In this case portlet is in collapsed state, after user loged in again. and when I am trying to expand the portlet I can see the blank grid as shown in the fig. To solve this I found the workaround i.e. while expanding or collapsing I am passing animcollpase obj.

Here is my code.



if(panelHeader.ownerCt.collapsed){
minimiseMaximizeFlg="maximize";
panelHeader.ownerCt.expand(panelHeader.ownerCt.animCollapse);
}else{
minimiseMaximizeFlg="minimize";
panelHeader.ownerCt.collapse(panelHeader.ownerCt.collapseDirection, panelHeader.ownerCt.animCollapse);
}


This works fine in the Chrome but in Mozilla or in IE8 I am getting following error.



me.el.getStyle("background-position") is null





info = me.el.getStyle('background-position').split(' ');and view.getComputedStyle(div.firstChild.firstChild, null) is null





Please what is missing here.