PDA

View Full Version : Hint about "Altering Standard Panel Layout" [layout FAQ]



mabra
12 Aug 2009, 1:30 PM
Hi !

In the layout FAQ [http://extjs.com/learn/Ext_FAQ_layout#Partially_Collapse_a_Panel] (http://extjs.com/learn/Ext_FAQ_layout#Partially_Collapse_a_Panel%5D) I used the script technic mentioned there to alter the layout. But this gave a problem to me. The FAQ explains this with the fbar, I used the tbar. The problem, I faced with was:After I moved my top toolbar to the panels header, I had an unwanted space area between the toolbar and the body. This appeared only in IE[6.x], not in FF.

The code, described on the FAQ was:


p.footer.dom.appendChild(p.getBottomToolbar().el.dom);
As one can see from the attached image, this left an additional <div> in the bwrap, which was holding the tbar before [in the image, the uneccesary element has a red border].

I removed that additional and unneeded element with the following code:


var elem = panel.getTopToolbar().el.dom;
var wrap = panel.bwrap.dom;
wrap.removeChild(wrap.childNodes[0]); //This does it!
panel.header.dom.appendChild(elem);
So, after this small script change, the space disappeared.
Hope, this helps someone.http://www.extjs.com/forum/images/icons/icon7.gif

br--mabra