开发者

extjs Panel fit layout

开发者 https://www.devze.com 2023-02-23 09:31 出处:网络
I have a panel and i am rendering it into a container. I want the panel to fit into the container height and don\'t want to specify the height of the panel.

I have a panel and i am rendering it into a container. I want the panel to fit into the container height and don't want to specify the height of the panel.

But don't seem to work is there a way I could do it.

CODE SNIPPET

<div id=Div style="width: 100%; height: 100%;"></div>
var newPanel = new Ext.Panel({
    id: 'newPanel',
    renderTo: 'Div',
    la开发者_运维技巧yout: 'fit',
    border: false,
    items: [anotherPanel]
})

any ideas please help


You could use this plugin: http://www.sencha.com/forum/showthread.php?28318-Fit-to-parent&highlight=fitToParent


Use the 'fit' layout on the container, and set autoheight and autowidth to false on the child panel. The fit layout should take care of making the components inside it automagically 'fit'.


You can also try below code:

autoHeight: true
0

精彩评论

暂无评论...
验证码 换一张
取 消