-
7 Jun 2012 9:57 PM #1
Please help! Extjs 4.x panel resize not working while window resizes
Please help! Extjs 4.x panel resize not working while window resizes
I want to resize the panel according to window screen resizing. How can I get this done? This works perfect in 2.x but not working in 4.x. Please help me to get this fixed.
I have tried this two methods,
Method:1
Ext.create('Ext.panel.Panel', { title: 'Hello', autoWidth: true,
autoheight: true, html: '<p>World!</p>', renderTo: Ext.getBody() });
Method:2
Ext.onReady(function() {
var configs = [
{
title: 'Hello',
autoWidth: true,
autoheight: true,
html: '<p>World!</p>',
renderTo: Ext.getBody()
}
];
Ext.each(configs, function(config) {
var element = Ext.getBody().createChild({cls: 'panel-container'});
Ext.createWidget('panel', Ext.applyIf(config, {
}));
});
});
-
7 Jun 2012 10:37 PM #2
Hi!
For your main container, i suggest hbox and/or vbox layouts with various flex settings.
or you can use use onWindowResize event manager-
see the docs for more specifications:- http://docs.sencha.com/ext-js/4-1/#!...onWindowResizeCode:Ext.EventManager.onWindowResize(function () { var width=Ext.getBody().getViewSize().width-100 ,height = Ext.getBody().getViewSize().height - 140; panel.setSize(width, height); });sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
12 Jun 2012 1:09 AM #3
-
16 Jun 2012 9:22 AM #4
-
17 Jun 2012 10:37 PM #5
-
8 Jul 2012 11:21 PM #6
FIxed
FIxed
Fixed by using view port,
Ext.onReady(function(){
var childPanel1 = Ext.create('Ext.panel.Panel', {
title: 'Child Panel 1',
renderTo: "customer",
collapsible:true,
contentEl: "customerInfo"
});
var childPanel2 = Ext.create('Ext.panel.Panel', {
title: 'Child Panel 2',
renderTo: "listing",
collapsible:true,
contentEl: "listingSearch"
});
Ext.create('Ext.container.Viewport', {
items: [ childPanel1, childPanel2 ]
});
});


Reply With Quote