View Full Version : Fit Child Form in parent Form Extjs

16 Dec 2013, 6:06 AM
I have a Parent Panel with a child Panel dynamically added which will have any number of grand children panels.
Only the Parent Panel's xtype and grand children's Xtype view is defined. Other panels are defined dynamically and added to the Parent panel in controller.
while doing so my grand child panel is taking width of its parent ie (child panel) but child panel is taking width more than its parent panel.
How to solve this. Can anyone help.
var ParentPanel= this.getCmtFeeAllctnPnl(); //getting from reference xtype

for (var i = 0; i < 2; i++) {// child panel created

var childPanel= Ext.widget('panel',{
name:'feeDetailsPanel' ,

;//loop for adding grand children to children

for (var j = 0; j < 2; j++) {

var grandChildPanel= Ext.widget('grandchild', {

childPanel.add(grandChildPanel); }//adding everything to parent panel




But the child panel is rendering around 1370 pixel I cannot use pixel as user can change the parent screen size It should be 100 % to its parent.
Thanks in advance

16 Dec 2013, 7:40 AM
Seems like the way you are adding child into the container in this case window is not right. If you use proper layout; sizing part will be taken care by framework automatically. For more information please look into this Fiddle.https://fiddle.sencha.com/fiddle/27v/