var len = panel.items.items.length;
if(len < 15){
panel.add(this.childPanel);
panel.doLayout();
}
// the items inside panel remains unchanged even after performing doLayout()
Problem was with the creation of childPanel. While creating child panel I made the id field of childPanel dynamic by giving an index to it.
ChildPanel.superclass.constructor.call(this, {
id : 'panel'+this.index,
items : []
});
This way each childPanel created will have different ids.
var len = panel.items.items.length;
if(len < 15){
panel.add(this.childPanel);
panel.doLayout();
}
this code worked perfectly after that!