extjs Panel fit layout

廉价感情. 提交于 2019-12-23 13:09:12

问题


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',
    layout: 'fit',
    border: false,
    items: [anotherPanel]
})

any ideas please help


回答1:


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




回答2:


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'.




回答3:


You can also try below code:

autoHeight: true


来源:https://stackoverflow.com/questions/5603924/extjs-panel-fit-layout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!