PDA

View Full Version : Viewport behavior within a div



oravecz
9 Oct 2013, 5:14 AM
I have a div on my page with a fixed height and width. I would like to render an Ext.panel.Panel into this fixed div and have its height and width fill the div. Of course the multitude of posts asking for something like this indicate that there is no 'fit' on Panel (too bad), or to use Viewport (this panel will be inside a div, not body), or to use a layout manager (I am using border layout in my panel).

If I give the panel the same height/width values as my div, it looks fine. Is there a way to programmatically accomplish this? I am not developing an entire ExtJS application; I only want to use certain components in a web page.

Farish
9 Oct 2013, 5:24 AM
one simple way to do this is to use a panel with width and height set to '100%' and renderTo: 'divId'. this will make the panel expand and occuppy the complete height and width of your div without having to assign it a fixed height and width in pixels etc.