PDA

View Full Version : The components in the Window should be resized when the window is resized.



BMK
6 Jul 2012, 2:24 AM
Need Help!!

How can the components in the window will be resized when the window is resized.

Note: We are defining few components in the handler function as well.

sword-it
6 Jul 2012, 2:45 AM
Hi BMK,

Are you talking about Ext.window or Browser window ? If it is browser window you simply put your component Under Ext.container.Viewport, component will be automatically re-size when browser window resizing.

for more information see http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.Viewport

BMK
6 Jul 2012, 3:10 AM
It the Browser Window.

I tried placig the component in the Ext.container.Viewport. Now i am getting the below error.

Uncaught TypeError: Cannot read property 'flex' of undefined.

Please suggest the Process.

sword-it
6 Jul 2012, 3:26 AM
Ext.create('Ext.container.Viewport', {
layout: 'fit',
renderTo:Ext.getBody(),
items: [
{
xtype: 'panel',
title: 'Hello! Welcome to Ext JS.',
tbar:[
{
text:'Left-Section',
width:100
},
'->',
{
text:'Right-Section',
width:100
}
]
}
]
});

BMK
6 Jul 2012, 3:45 AM
Thanks for you help!!

I tried in the same way but still it is not working. FYI: The header for the application is coming from the PL file.

If i use the Viewport ,the component is getting displayed on the top. ie before the header.

The component is the tabbedpanel that has 3 tabs. And in the each tab we have 1 combo box and 1 button.There are few components(grids) which are defined inside the handler function.They also should be resized once the browser is resized.

Thanks

scottmartin
6 Jul 2012, 9:54 AM
Please create a small working example of your setup so we can move forward.

Scott.