admin管理员组文章数量:1417042
This one didn't work:
new Ext.Window({
width:'100%',
height: '100%'
}).show();
I has do be fluid, so that when the window is resized it has to change its diemensions.
This one didn't work:
new Ext.Window({
width:'100%',
height: '100%'
}).show();
I has do be fluid, so that when the window is resized it has to change its diemensions.
Share Improve this question asked Jul 26, 2011 at 7:13 ilhanilhan 9,01335 gold badges127 silver badges214 bronze badges2 Answers
Reset to default 4This can only be achieved by monitoring window.resize
event.
Ext.onReady(function() {
var win = new Ext.Window({
draggable: false
});
win.show();
win.setSize(Ext.getBody().getViewSize());
win.setPagePosition(0, 0);
Ext.fly(window).on('resize', function(e, w) {
win.setSize(Ext.getBody().getViewSize());
win.setPagePosition(0, 0);
});
});
Notice that my example works properly if body
has overflow: hidden
. Otherwise unwanted scrollbars will be shown.
Check out this fiddle.
This can also be achieved by creating a Viewport, which is designed to do exactly what you're asking. Here's a quick example, and it shows that you don't need to specify any heights/widths:
Ext.onReady(function(){
var thisView = new Ext.Viewport({
layout:'anchor',
items:[
{ title: 'Section 1'
,html: 'some content'
}
,{ title: 'Section 2'
,html: 'some more content'
}
]
});
});
You'll note that you don't even need to "show" it.
EDIT: Oh, I meant to also remark that if you add some longer content into those html sections, you'll see that if you resize your browser window, they will change their heights automatically to let all the content be seen.
本文标签: javascriptHow can I make a window in 100 height and width with ExtJsStack Overflow
版权声明:本文标题:javascript - How can I make a window in 100% height and width with ExtJs? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745265979a2650603.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论