extjs在hbox中的100%高度 [英] extjs 100% height in hbox

查看:309
本文介绍了extjs在hbox中的100%高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在extjs中是新的,只是在hbox设置中坚持动态(百分比)的高度。对不起,我可以在sencha小提琴上提供我的代码,所以我简化了我的问题,



这里是代码

  Ext.application({
name:'Fiddle',

launch:function(){
Ext.create('Ext.Container ',{
width:100%,
height:200,
title:HBoxLayout Panel,
layout:{
type:'hbox'
align:'stretch'
},
renderTo:document.body,
items:[{
xtype:'panel',
title:'内部面板1',
flex:2
},{
xtype:'panel',
title:'Inner Panel Two',
flex:1
},{
xtype:'panel',
title:'Inner Panel Three',
flex:1
}]});}});

如何将容器的高度更改为100%,而不是静态像素值,如下所示案例200,



感谢大家

解决方案

m / p>

所以我不认为使用布局合适,然后指定第二个容器高度到45%的工作。如果您对第二个容器使用固定的高度,那可能会起作用。但是我不认为%会做。



尝试第一个容器的另一个布局,也许锚点将按照您的期望工作。



以下是sencha布局的链接... http://dev.sencha.com/deploy/ext-4.0.0/examples/layout-browser/layout-browser.html



编辑



嗯,这似乎根本不像你在编辑之前发布的帖子。尝试我建议的第一个代码。



如果我们使用你的实际代码,那么最好,但是你现在发布的这段代码... https://fiddle.sencha.com/#fiddle/3hg


I am new in extjs and just stuck on dynamic (percent) height in hbox setting. Sorry i could provide you my code on sencha fiddle, so i simplified my question,

here is code

Ext.application({
name : 'Fiddle',

launch : function() {
    Ext.create('Ext.Container', {
width: "100%",
height: 200,
title: "HBoxLayout Panel",
layout: {
    type: 'hbox',
    align: 'stretch'
},
renderTo: document.body,
items: [{
    xtype: 'panel',
    title: 'Inner Panel One',
    flex: 2
},{
    xtype: 'panel',
    title: 'Inner Panel Two',
    flex: 1
},{
    xtype: 'panel',
    title: 'Inner Panel Three',
    flex: 1
}]});}});

how i can change a height of container to be 100% and not static pixel value, as in this case 200,

Thanks everyone

解决方案

As far as I'm concerned, an item contained in a view with fit layout, will fit its parent's container.

So I don't think using layout fit and then specifying the second container height to 45% will work. That may work though if you use a fixed height for the second container. But I don't think % will do.

Try another layout for the first container, maybe anchor will work as you expect.

Here's a link to sencha layouts... http://dev.sencha.com/deploy/ext-4.0.0/examples/layout-browser/layout-browser.html

EDIT

Well, this doesn't seem at all like the post you posted before your edit. Try what I suggested for your first code.

It would be best if we used your actual code, but as for this code you posted now... https://fiddle.sencha.com/#fiddle/3hg

这篇关于extjs在hbox中的100%高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆